切换到openjdk后无法在eclipse中启动服务器 [英] cant start server in eclipse after switch to openjdk

查看:141
本文介绍了切换到openjdk后无法在eclipse中启动服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近下载了openJdk 14并解压缩然后,我去了Eclipse>Java>已安装的JRE并设置要使用的新jdk

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

但是,执行此操作后,我将无法再运行服务器(tomcat webapp)我从jdk中得到了一个错误

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

以及eclipse中的一个通用错误,说它无法启动

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:

(用户变量)

%JAVA_HOME%= C:\ JavaProgramFiles \ jdk-14.0.2

%JAVA_HOME% = C:\JavaProgramFiles\jdk-14.0.2

(系统和用户变量)

路径%JAVA_HOME%\ bin

Path %JAVA_HOME%\bin

更新1(FYI删除了一些路径内容,因为它似乎不再相关了):

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

感谢@KunLun

当进入bin目录时,javac -version起作用了.我再次检查了环境变量,这次将%JAVA_HOME%/bin添加到我的用户的Path变量中(以前它仅在系统路径中).因此,现在javac -version可以从任何目录运行.尽管我确实在控制台中得到了这个新的味精,但是当我启动服务器时,Eclipse仍然有相同的错误?

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不支持.模块化的认可标准和独立API表单将通过可升级模块的概念得到支持.

-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.

推荐答案

您引用的错误消息显示了问题的原因.定义服务器实例后,为其设置的JVM启动参数包括对认可目录的引用,该参数通过Java 8有效,但不适用于Java 9和更高版本.当从服务器视图"内部打开服务器实例的编辑器时,在常规信息部分中,单击运行时环境链接,然后将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.

这篇关于切换到openjdk后无法在eclipse中启动服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆