简体   繁体   English

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

[英]Unable to run Dynamic Web Project - Java EE

Initially, I had jdk10 installed with Tomcat 9. I couldn't run any Dynamic Web Project with the following error: 最初,我在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.

After some research, it seemed that there is some incompatibility between jdk9/10 and Tomcat 9. 经过研究,似乎jdk9 / 10与Tomcat 9之间存在不兼容。

So I downloaded and installed jre8 and Tomcat 8 but I am still unable to run the app for the same reason. 因此,我下载并安装了jre8和Tomcat 8,但由于相同的原因,我仍然无法运行该应用程序。

在此处输入图片说明

在此处输入图片说明

Eclipse Preferences > Java > Compiler already points at 1.8 Eclipse首选项> Java>编译器已经指向1.8

I cleaned the project and created a new one to make sure the new settings apply to the new project, yet the same error happens. 我清理了该项目并创建了一个新项目,以确保新设置适用于新项目,但是会发生相同的错误。 And I don't know why on the console it still says jdk10. 而且我不知道为什么在控制台上仍然显示jdk10。

在此处输入图片说明

My machine runs Antergos Linux and Oxygen Eclipse 4.7.3 我的机器运行Antergos Linux和Oxygen Eclipse 4.7.3

Any input is highly appreciated, thanks! 非常感谢任何输入,谢谢!

I had the same problem on eclipse. 我在日食上有同样的问题。 While the path variables and the workspace JDK was java 8, tomcat was still configured to use java 10 no matter what. 尽管路径变量和工作区JDK是Java 8,但无论如何,tomcat仍配置为使用Java 10。 I had to change tomcat configuration. 我不得不更改tomcat的配置。

In eclipse you have to open the "Servers" view, double click on tomcat server (it opens the server configuration page) -> click on runtime environment -> choose jdk8. 在Eclipse中,您必须打开“服务器”视图,双击tomcat服务器(它将打开服务器配置页面)->单击运行时环境->选择jdk8。 This fixed the issue for me. 这为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM