How to use Tomcat 8.5.x and TomEE 7.x with Eclipse?

EclipseTomcatApache TomeeTomee 7

Eclipse Problem Overview


I need to setup a Tomcat 8.5.x server version in Eclipse. When I try to create a server using Eclipse GUI, I get in Eclipse Luna as choice the latest version "Apache Tomcat v8.0". When I select it and I browse to my Tomcat 8.5.x server, I get this blocking error message:

> The Apache Tomcat installation at this directory is version 8.5.0. A > Tomcat 8.0 installation is expected.

The same error appears when trying TomEE 7.x, which is internally based on Tomcat 8.5.

In Eclipse Neon the latest version as choice is "Apache Tomcat v9.0" and it gives the same error. There isn't even a "Apache Tomcat v8.5" option.

Is there a way to use Tomcat 8.5 and TomEE 7.x in Eclipse? How?

Eclipse Solutions


Solution 1 - Eclipse

You have to patch catalina.jar, as this is version number the WTP adapter looks at. It's a quite useless check, and the adapter should allow you to start the server anyway, but nobody has though of that yet.

For years and with every version of Tomcat this is always a problem.

To patch you can do the following:

  • cd [tomcat or tomee home]/lib
  • mkdir catalina
  • cd catalina/
  • unzip ../catalina.jar
  • vim org/apache/catalina/util/ServerInfo.properties

Make sure it looks like the following (the version numbers all need to start with 8.0):

server.info=Apache Tomcat/8.0.0
server.number=8.0.0
server.built=May 11 2016 21:49:07 UTC

Then:

  • jar uf ../catalina.jar org/apache/catalina/util/ServerInfo.properties
  • cd ..
  • rm -rf catalina

Solution 2 - Eclipse

There is a patch for Eclipse:
https://bugs.eclipse.org/bugs/attachment.cgi?id=262418&action=edit

Download this patch and put it to the plugins directory of your Eclipse installation. It will replace the default "org.eclipse.jst.server.tomcat.core_1.1.800.v201602282129.jar".

NOTE
After you add this patch you must choose "Apache Tomcat v9.0" when adding a server runtime environment in the Eclipse (Preferences > Server > Runtime Environments).
I.e. this patch allows you to select either Tomcat version 9.x or Tomcat version 8.5.x when adding Apache Tomcat v.9.0 runtime environment.


More details on can be found on the related bug report page: https://bugs.eclipse.org/bugs/show_bug.cgi?id=494936

Solution 3 - Eclipse

For Tomcat 8.5.x users

You've to change the ServerInfo.properties file of Tomcat's /lib/catalina.jar file.

ServerInfo.properties file contains the following code

server.info=Apache Tomcat/8.5.4
server.number=8.5.4.0
server.built=Jul 6 2016 08:43:30 UTC

Just open the ServerInfo.properties file by opening the catalina.jar with winrar from your Tomcat's lib folder

ServerInfo.properties file location in catalina.jar is /org/apache/catalina/util/ServerInfo.properties

Notice : shutdown the Tomcat server(if it's already opened by cmd) before doing these things otherwise your file doesn't change and your winrar shows error.

Then change the following code in ServerInfo.properties

server.info=Apache Tomcat/8.0.8.5.4
server.number=8.5.4.0
server.built=Jul 6 2016 08:43:30 UTC

Restart your eclipse(if opened). Now it'll work...

ScreenShot of eclipse

Solution 4 - Eclipse

As for now Eclipse Neon service release is available. So if someone is still encounters this trouble, just go to

Help → Check for Updates

and install provided updates related to : org.eclipse.jst

Solution 5 - Eclipse

This workaround worked for me. I edited the serverInfo.properties file as given below:

server.info=Apache Tomcat/8.0.0
server.number=8.0.0.0
server.built=Oct 6 2016 20:15:31 UTC

Solution 6 - Eclipse

Install the latest version of eclipse(). It would have the option to add Tomcat 8.5.

Solution 7 - Eclipse

I had similar issues with Eclipse Kepler v3.8 I had tomcat v8.5.37 installed. I couldn't see Apache v8.5 as an option. By skimming through StackOverflow I found Apache v9.0 is available on Eclipse Neon. Cool thing is you don't have to change your eclipse version. In your current Eclipse. Download WTP(Web Tools Package) by following the steps:

Step 1: Help >>> Install New Software. Copy this link in the Work with: http://download.eclipse.org/webtools/repository/neon

Step 2: Select JST Server Adapters and JST Server Adapters Extensions from the first package you see. Install those.

Step 3: Windows >>> Preferences >>> Server >>> Runtime Environments >>> Add..

You'll see Apache v9.0 there! It works!

Solution 8 - Eclipse

Go to the preview version of tomcat e.g. : tomcat 8.3 and copy catalina.jar file and paste into the existing tomcat which you have facing the issue

Solution 9 - Eclipse

Forgive me for invoking old problem. But it is like legendary, always happen for new users. The reason I am here is I want to purpose different answer. Rather simple. Please fo to windows->preference->Runtime Environment->search and select the folder where you download the server. It will automatically detect the server and you are good to go.

Solution 10 - Eclipse

I'm guessing that you are running Eclipse Mars, or an even earlier release. You need to upgrade to Eclipse Neon or later

Solution 11 - Eclipse

> Navigate to /apache-tomcat-8.5.65/lib/org/apache/catalina/util/ServerInfo.properties > Then change > server.info=Apache Tomcat/8.5.65 > server.number=8.5.4.0 > server.built=Jul 6 2021 00:29:43 UTC >
>
>
>
> server.info=Apache Tomcat/8.0.8.5.4 > server.number=8.5.4.0 > server.built=Jul 6 2016 08:43:30 UTC

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser5796595View Question on Stackoverflow
Solution 1 - Eclipsedexter meyersView Answer on Stackoverflow
Solution 2 - EclipseFkJView Answer on Stackoverflow
Solution 3 - EclipseVinoth VinoView Answer on Stackoverflow
Solution 4 - EclipseCryptorView Answer on Stackoverflow
Solution 5 - EclipseVikdView Answer on Stackoverflow
Solution 6 - EclipseSandipanView Answer on Stackoverflow
Solution 7 - EclipsedivyajyotiukView Answer on Stackoverflow
Solution 8 - EclipseSanjayView Answer on Stackoverflow
Solution 9 - EclipseparladView Answer on Stackoverflow
Solution 10 - EclipseYoussef El-kantriView Answer on Stackoverflow
Solution 11 - EclipseSy.MohView Answer on Stackoverflow