Skip to content
Advertisement

cant start server in eclipse after switch to openjdk

I recently downloaded and unziped openJdk 14 I then went to Eclipse > Java > Installed JREs and set the new jdk to be used enter image description here

However after doing this I am no longer able to run my server (tomcat webapp) I get an error from the jdk

enter image description here

as well as a generic error in eclipse saying it failed to start

When googling around it said to check my paths, but as far as i can tell they are correct:

(user variable)

%JAVA_HOME% = C:JavaProgramFilesjdk-14.0.2

(system & user variable)

Path %JAVA_HOME%bin

Update 1 (FYI removed some path stuff as it doesnt seem relevant anymore):

thanks @KunLun

when cd’ing into the bin directory, javac -version worked. I reviewed environment variables again and this time added %JAVA_HOME%/bin to my User’s Path variable (previously it was only in system path). So now javac -version works from any directory. However Eclipse still has same error when i start my server, though i do get this new msg in the console?

-Djava.endorsed.dirs=C:JavaProgramFilestomcatapache-tomcat-9.0.21endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.

Advertisement

Answer

The error message you quoted shows the cause of the problem. When the server instance was defined, the JVM launch arguments set for it included a reference to endorsed directories, an argument valid through Java 8, but not for Java 9 and newer. When you open the editor for your server instance from inside the Servers View, in the General Information section, Click on the Runtime Environment link and change the JRE explicitly to a Java 8 version. The server should then start up again.

Changing the JRE used to launch Tomcat

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement