Reputation: 1191
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!
Upvotes: 1
Views: 1325
Reputation: 5452
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.
Upvotes: 1