Eclipse(2020年09月)Java安装问题 || Windows 10操作系统

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

Eclipse(2020 09) Java Installation issue || Windows 10 OS

问题

我是Java编程的新手。我已经在我的操作系统上安装了Java SE 11(LTS)(JDK 11.0.8)。需要注意的是,之前的Java版本中也有一个jre文件夹。但是从Java 11开始,只有JDK文件夹。

因此,我已经设置了JAVA_HOME环境变量,并在路径中包括了jdk\bin目录。

通过在命令提示符(cmd)中检查,java版本显示如下:

C:\Users\user>java -version
java version "11.0.8" 2020-07-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.8+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode)

然后我安装了Eclipse 2020 09版本。但是创建一个简单的Hello World项目却无法工作。并且多次显示以下错误:

Description Resource Path Location Type
The project was not built due to "Failed to init ct.sym for C:\Users\Irfan Umar\AppData\Local\Temp\eoiE758.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v20200815-0932\jre\lib\jrt-fs.jar".
Fix the problem, then try refreshing this project and building it since it may be inconsistent HelloWorld Unknown Java Problem

解决方案是什么,我认为与JDK中不再提供JRE有关。

英文:

I am new to Java programming. I have installed Java SE 11 (LTS) (JDK 11.0.8) on my OS. Note that former Java also has jre folder in it. But Java 11 onward there come only JDK folder.
So, I have set JAVA_HOME environment variable as well as, included jdk\bin in path as well.
By checking on cmd java version shows as follow:


C:\Users\user>java -version

java version "11.0.8" 2020-07-14 LTS

Java(TM) SE Runtime Environment 18.9 (build 11.0.8+10-LTS)

Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode)

Then I installed eclipse 2020 09 version. But by making a simple Hello World project does not work.
And shows this error multiple times.

Description Resource Path Location TypeThe project was not built due to "Failed to init ct.sym for C:\Users\Irfan Umar\AppData\Local\Temp\eoiE758.tmp\plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v20200815-0932\jre\lib\jrt-fs.jar". Fix the problem, then try refreshing this project and building it since it may be inconsistent HelloWorld Unknown Java Problem

What is the solution, I believe it is related to JRE not provided in JDK now.

答案1

得分: 1

Eclipse以两种方式使用Java。它使用Java运行Eclipse,并允许在首选项中指定Java运行环境。我很少看到设置JAVA_HOME的理由,因为我会指定要使用的JDK的路径。我总是安装了多个JDK。

我通过在“eclipse.ini”文件中设置“-vm”路径(指向“bin”目录)来指定要用于运行Java的JDK。

我通过在首选项中添加JRE(有时编辑“Java Runtime Environments”的子部分“Execution Environments”)来指定要用于编译代码的JDK,以及指向特定JRE。

英文:

Eclipse uses Java in two ways. It runs Eclipse with Java, and it allows specifying Java Runtime Environments in Preferences. I rarely see any reason to set JAVA_HOME anymore, because I specify the paths to the JDKs I want to use. I always have multiple JDKs installed.

I specify which JDK to use to run Java by setting the "-vm" path in the "eclipse.ini" file (which points to the "bin" directory).

I specify which JDK to use to compile code by adding JREs in preferences, and sometimes editing the "Execution Environments" (subsection of "Java Runtime Environments") to point to specific JREs.

huangapple
  • 本文由 发表于 2020年10月11日 14:27:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/64301220.html
匿名

发表评论

匿名网友

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

确定