简体   繁体   中英

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:

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

So I downloaded and installed jre8 and Tomcat 8 but I am still unable to run the app for the same reason.

在此处输入图片说明

在此处输入图片说明

Eclipse Preferences > Java > Compiler already points at 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.

在此处输入图片说明

My machine runs Antergos Linux and 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. I had to change tomcat configuration.

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. This fixed the issue for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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