为什么Unity3d找不到Java for Android SDK
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24945837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why Unity3d can not find Java for Android SDK
提问by Yogurt The Wise
For days now I;ve been getting the error below with
几天来,我一直收到以下错误
- Unity 3d v4.3.2f1
- jdk1.8.0_11
- Android SDK v0.8
- Unity 3d v4.3.2f1
- jdk1.8.0_11
- 安卓 SDK v0.8
Error building Player: UnityException: Unable to find suitable jdk installation. Please make sure you have a suitable jdk installation. Android development requires at least JDK 6 (1.6). The latest JDK can be obtained from the Oracle http://www.oracle.com/technetwork/java/javase/downloads/index.html
构建播放器时出错:UnityException:无法找到合适的 jdk 安装。请确保您有合适的 jdk 安装。Android 开发至少需要 JDK 6 (1.6)。最新的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. Fooled with the Fond_Java.bat in android tools folder. Reinstalled JDK/JRE 32bit and 64 bit, removed 64bit(twice)
我弄乱了环境变量(PATH、JAVA_HOME、JDK_HOME)重新安装了 Android SDK。被 android 工具文件夹中的 Fond_Java.bat 愚弄了。重新安装 JDK/JRE 32 位和 64 位,移除 64 位(两次)
Android SDK opens perfectly find when the Path vars are set correctly. But for some reason Unity will not build the Android player.
当路径变量设置正确时,Android SDK 打开完美。但出于某种原因,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?
回答by user2052497
try to install x86 JDK.
i have windows 8.1 x64 and i also had same problem. 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.
尝试安装 x86 JDK。
我有 Windows 8.1 x64,我也有同样的问题。我尝试了 PATH 的所有变体,重新安装等,最后我决定尝试在我的 x64 窗口中安装 x86 jdk,在这个统一构建成功之后我的 apk。
回答by Eugene
Set up JAVA_HOME variable. The example is here: http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html
设置 JAVA_HOME 变量。示例在这里:http: //docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html