Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache tomcat 9.x not working with eclipse & Java 10.0.1

I've installed apache-tomcat-9.0.7 on my windows machine and have following environment configurations:

echo %JAVA_HOME%

C:\Program Files\Java\ jdk-10.0.1


echo %JRE_HOME%

C:\Program Files\Java\ jre-10.0.1


OS : Windows 8 64-bit


Eclipse Version: Oxygen.3a Release (4.7.3a)


Whenever I run catlina.bat start from cmd, server runs fine on localhost But I'm not able to get the server instance up from eclipse's server configuration.

  1. Defined a new server in eclipse and added apache-tomact 9.0 instance
  2. Upon clicking on start server , I get the following error:

    -Djava.endorsed.dirs=C:\Softwares\apache-tomcat-9.0.7\endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules.

Error Screen

Any solution for this issue ?

like image 748
Saurabh Bhoomkar Avatar asked Apr 29 '18 10:04

Saurabh Bhoomkar


People also ask

How do I use Apache Tomcat in Eclipse?

For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.

Is Tomcat 9 backwards compatible?

The Tomcat developers aim for each patch release to be fully backwards compatible with the previous release.

What version of Java does Tomcat 9 use?

Apache Tomcat 9. x and 8.5. x and implements the Servlet 4.0, JSP 2.3, EL 3.0, WebSocket 1.1 and JASPIC 1.1 specifications (the versions required by Java EE 8 platform).

Why is my Tomcat not working?

Most common issue with Tomcat note starting is that Java is not configured properly, user trying to start Tomcat does not have permissions to do so, or another program is using port 8080 on that server.


1 Answers

In my Eclipse Oxygen IDE, WTP version did not update as suggested by @nitind.

I figured out a fix with some trial and error as I wanted to change JRE version for Tomcat

  1. To use Tomcat 8 with JRE 8 Eclispe --> Preferences --> Server --> Runtime Environments --> Select Tomcat 8 --> Edit --> Change default JRE to JRE 8

Also change JDK version in Compiler & Project Facets

  1. Eclispe --> Preferences --> Server --> Runtime Environments --> Select Tomcat 9 --> Edit --> Change default JRE to JRE 9

Also change JDK version to 9 in Compiler & Project Facets

Also need to remove -Djava.endorsed argument from "Runtime Configurations" in Project right click --> Run As --> Run Configurations --> Apache Tomcat

It will surely work! :)

like image 173
Nandakumar Purohit Avatar answered Sep 21 '22 19:09

Nandakumar Purohit