无法在切换到OpenJDK后在Eclipse中启动服务器。

huangapple go评论19阅读模式
英文:

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 %JAVA_HOME%\bin

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
无法在切换到OpenJDK后在Eclipse中启动服务器。

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

无法在切换到OpenJDK后在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:

(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版本。然后服务器应该可以重新启动。

无法在切换到OpenJDK后在Eclipse中启动服务器。

英文:

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中启动服务器。

huangapple
  • 本文由 发表于 2020年7月31日 02:12:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/63178967.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定