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 jdkbin in path as well. By checking on cmd java version shows as follow:
C:Usersuser>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:UsersIrfan UmarAppDataLocalTempeoiE758.tmppluginsorg.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_14.0.2.v20200815-0932jrelibjrt-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.
Advertisement
Answer
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.