gpt4 book ai didi

java - 无法运行动态 Web 项目 - Java EE

转载 作者:行者123 更新时间:2023-11-28 22:24:55 31 4
gpt4 key购买 nike

最初,我在 Tomcat 9 上安装了 jdk10。我无法运行任何动态 Web 项目,出现以下错误:

-Djava.endorsed.dirs=/usr/local/src/apache-tomcat-8.5.31/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

经过一番研究,似乎jdk9/10与Tomcat 9之间存在一些不兼容的问题。

所以我下载并安装了 jre8 和 Tomcat 8,但由于同样的原因我仍然无法运行该应用程序。

enter image description here

enter image description here

Eclipse 首选项 > Java > 编译器已经指向 1.8

我清理了项目并创建了一个新项目以确保新设置适用于新项目,但还是发生了同样的错误。而且我不知道为什么在控制台上它仍然说 jdk10。

enter image description here

我的机器运行 Antergos Linux 和 Oxygen Eclipse 4.7.3

非常感谢任何输入,谢谢!

最佳答案

我在 eclipse 上遇到了同样的问题。虽然路径变量和工作区 JDK 是 java 8,但无论如何 tomcat 仍然配置为使用 java 10。我不得不更改 tomcat 配置。

在 Eclipse 中,您必须打开“服务器” View ,双击 tomcat 服务器(它会打开服务器配置页面)-> 单击运行环境 -> 选择 jdk8。这为我解决了这个问题。

关于java - 无法运行动态 Web 项目 - Java EE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50583385/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com