英文:
cant start server in eclipse after switch to openjdk
问题
I recently downloaded and unziped openJdk 14
我最近下载并解压了openJdk 14。
I then went to Eclipse > Java > Installed JREs and set the new jdk to be used
然后我进入Eclipse > Java > 已安装的JREs,并设置新的jdk供使用。
However after doing this I am no longer able to run my server (tomcat webapp)
然而,在这样做之后,我再也无法运行我的服务器(Tomcat Web应用程序)。
I get an error from the jdk
我从jdk获得一个错误。
as well as a generic error in eclipse saying it failed to start
以及在Eclipse中出现一般错误,表示启动失败。
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
Update 1 (FYI removed some path stuff as it doesnt seem relevant anymore):
更新1(提醒:删除了一些路径内容,因为似乎不再相关):
thanks @KunLun
谢谢 @KunLun
when cd'ing into the bin directory, javac -version worked.
当进入bin目录时,javac -version可以工作。
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).
我再次查看了环境变量,并这次将%JAVA_HOME%/bin添加到我的用户路径变量中(之前只有系统路径中)。
So now javac -version works from any directory.
现在,无论从哪个目录中,javac -version都可以工作。
However Eclipse still has same error when i start my server, though i do get this new msg in the console?
然而,当我启动服务器时,Eclipse仍然出现相同的错误,尽管我在控制台中收到了这个新的消息?
-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.
-Djava.endorsed.dirs=C:\JavaProgramFiles\tomcat\apache-tomcat-9.0.21\endorsed
不受支持。通过可升级模块的概念将支持模块化形式中的认可标准和独立API。
英文:
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 <includes> %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
得分: 1
错误消息中引用的内容显示了问题的原因。在定义服务器实例时,为其设置的JVM启动参数包括对认可目录的引用,这是Java 8有效的参数,但对于Java 9及更高版本无效。当您从Servers View中打开服务器实例的编辑器时,在General Information部分,点击Runtime Environment链接,将JRE明确更改为Java 8版本。然后服务器应该可以重新启动。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论