简体   繁体   English

为什么Unity3d找不到适用于Android SDK的Java

[英]Why Unity3d can not find Java for Android SDK

For days now I;ve been getting the error below with 几天以来我一直在收到以下错误

  • Unity 3d v4.3.2f1 Unity 3d v4.3.2f1
  • jdk1.8.0_11 jdk1.8.0_11
  • Android SDK v0.8 Android SDK v0.8

Error building Player: UnityException: Unable to find suitable jdk installation. 构建Player时出错:UnityException:无法找到合适的jdk安装。 Please make sure you have a suitable jdk installation. 请确保您安装了合适的jdk。 Android development requires at least JDK 6 (1.6). Android开发至少需要JDK 6(1.6)。 The latest JDK can be obtained from the Oracle http://www.oracle.com/technetwork/java/javase/downloads/index.html 最新的JDK可以从Oracle获得http://www.oracle.com/technetwork/java/javase/downloads/index.html

I have been to just about every site trying all types of ideas to get this to work. 我几乎每个网站都在尝试所有类型的想法,以使其发挥作用。 Someone out there must have an idea how to properly fix this. 有人在那里必须知道如何正确解决这个问题。

I have messed with the environmental vars (PATH, JAVA_HOME, JDK_HOME) Reinstalled Android SDK. 我搞乱了环境变量(PATH,JAVA_HOME,JDK_HOME)重新安装的Android SDK。 Fooled with the Fond_Java.bat in android tools folder. 被android工具文件夹中的Fond_Java.bat所欺骗。 Reinstalled JDK/JRE 32bit and 64 bit, removed 64bit(twice) 重新安装JDK / JRE 32位和64位,删除64位(两次)

Android SDK opens perfectly find when the Path vars are set correctly. 在正确设置路径变量时,Android SDK可以完美打开。 But for some reason Unity will not build the Android player. 但由于某些原因,Unity不会构建Android播放器。

Is it because I'm using the Android Beta SDK instead of the Eclipse ADT with ANDROID SDK? 是因为我使用Android Beta SDK而不是带有ANDROID SDK的Eclipse ADT?

In Unity, Edit > Preferences > External Tools` : 在Unity中, 编辑>首选项>外部工具`
Scroll to the bottom, you'll see the Android settings part, then you can browse the location of your JDK path. 滚动到底部,您将看到Android设置部分,然后您可以浏览JDK路径的位置。

在此输入图像描述

try to install x86 JDK. 尝试安装x86 JDK。
i have windows 8.1 x64 and i also had same problem. 我有Windows 8.1 x64,我也有同样的问题。 i tryed all variants with PATH, reinstalling and etc, in the end I decided to try install x86 jdk in my x64 windows, and after this unity build success my apk. 我尝试了所有变种与PATH,重新安装等,最后我决定尝试在我的x64窗口中安装x86 jdk,并在此统一构建成功后我的apk。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM