Unity异常:未找到JDK。

huangapple go评论77阅读模式
英文:

Unity exception JDK not found

问题

今天我尝试使用Unity Hub安装Unity(2020.1.4f1)。

我已经选择了以下模块:

  • Android构建支持(Android SDK和NDK工具 | OpenJDK)
  • iOS构建支持
  • 通用Windows平台构建支持
  • WebGL构建支持
  • Windows构建支持(IL2CPP)
  • 文档

安装已成功完成。
但是在我想构建Android应用程序(.apk)时出现了错误。
来自Unity的错误描述缺少JDK模块。

我尝试手动从Oracle安装JDK。
首先,我尝试了最新的JDK(jdk-8u261-windows-x64.exe),但这并没有解决问题。
其次,我尝试了较旧的JDK版本(jdk-8u251-windows-x64.exe),但这个版本也没有解决问题。

我已经手动设置了Java环境变量,但没有成功。

我安装了Android Studio,但也没有成功。

我希望有人能帮助我解决这个问题。

英文:

today I tried to install unity (2020.1.4f1) with the Unity Hub.

I have selected the following modules:

  • Android Build Support (Android SDK & NDK Tools | OpenJDK)
  • iOS Build Support
  • Universal Windows Platform Build Support
  • WebGL Build Support
  • Windows Build Support (IL2CPP)
  • Documentation

The installation is successfully completed.
But after I want to build an Android App (.apk) an error ouccurs.
The error from unity descripes that the JDK module is missing.

I tried to install the JDK manually from oracle.
Firstly I tried the newest JDK (jdk-8u261-windows-x64.exe) but this does not solve the problem.
Secondly I tried an older JDK version (jdk-8u251-windows-x64.exe) but even this one does not solve the problem.

I had set the Java envrionment variable manually, but wihtout success.

I installed Android Studio, but without success.

I hope there is someone who can help me to solve this problem.

答案1

得分: 0

我已经用以下解决方案解决了这个问题。

  1. 我以管理员权限运行了Unity Hub。
  2. 我选择了系统分区(在我这里是C:驱动器)作为安装目录(之前我曾使用文档目录进行安装)。

我认为安装过程中可能出现了批准问题。

英文:

I have solved this problem with the following solution.

  1. I have run the Unity Hub with administrator rights.
  2. I selected the system partition (in my case the C: drive) as installation directory (previously I had used the documents directory for installation)

I believe there was an approval problem with the installation process.

huangapple
  • 本文由 发表于 2020年9月8日 22:33:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/63796127.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定