Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The project was not built due to "Failed to init ct.sym for C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar" in IDE Eclipse

Tags:

java

eclipse

Good day! I did a servlet in IDE Eclipse, but I got this problem after creating a new Dynamic Web Project (File / New / Dynamic Wev Project).

I see this in Markers:

"The project was not built due to "Failed to init ct.sym for C:\Program Files\Java\jre-10.0.2\lib\jrt-fs.jar" in IDE Eclipse"

My servlet does not want to build. There is a java-file, but no class-file after building. I deleted, created, cleaned my project. Later I deleted and added Tomacat-server. Java EE is intalled.

No result. Google can`t help me.

Please, help me to solve this trouble...

like image 626
sebelousov Avatar asked Aug 17 '20 08:08

sebelousov


4 Answers

Whenever you create the java project using eclipse, you have 3 choices given which are,

  1. Use an execution environment JRE
  2. Use a project specific JRE
  3. Use default JRE 'jre-10.0.2' and workspace compiler preferences

Try to select the third choice.

like image 88
user14235983 Avatar answered Nov 09 '22 22:11

user14235983


Not sure if you've solve the problem or not but I just wanted to help since I was having the same problem just now.

  1. In eclipse go to Window.
  2. In Window go to Preference.
  3. In Preference, in the search bar type "Installed JREs"
  4. Edit the jre to the file directory in which your JDK is installed i.e C:\Program Files\Java\jdk-14.0.2 after that you can close and refresh and it should build fine.
like image 45
Myth_Star Avatar answered Nov 09 '22 23:11

Myth_Star


solution::

1.

Preference > Installed JREs > add > standard VM (not sure but works) > Directory > go to where you download your java (eg:G:\Java\jdk-15.0.1) > Finish Add JRE Path 1 Add JRE Path 2

2.

Preference > Installed JREs > execution environment > JavaSE-15 > choose jdk-15.0.1 > apply Change Exec Env

3.

Create your Java project. Create project



PS::

I used user14235983 's method before, it worked, but using this would cause a problem of not showing the documentation of the functions (in my case).

So I checked the library again. It seemed like there is something wrong with the path. So I tried to change it. And then it worked. And I came back here, look through Myth_Star & GokulnathP 's answer again, I found that we are using the same method.

In your question, it seems like you have the correct path. (So I am not sure whether we are having the same type of problem.) Maybe its because you are using "\Java\jre", but I am using "\Java\jdk". Else maybe try to reinstall your Java.

like image 8
Nor.Z Avatar answered Nov 09 '22 22:11

Nor.Z


I also had the 'Failed to init ct.sym for ..../jrt-fs.jar ' error in Eclipse 2021-03 with JRE from OpenJDK11 in a new Java project. For me the fix was to disable the "Use '--release' option" in the "Java Compiler" section of the project properties.

like image 2
the.unknowing Avatar answered Nov 09 '22 21:11

the.unknowing