cant start server in eclipse after switch to openjdk

一曲冷凌霜 提交于 2021-01-29 07:09:12

问题


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

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

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:\JavaProgramFiles\jdk-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:\JavaProgramFiles\tomcat\apache-tomcat-9.0.21\endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.


回答1:


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.



来源:https://stackoverflow.com/questions/63178967/cant-start-server-in-eclipse-after-switch-to-openjdk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!