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?
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):
Then:
jar uf ../catalina.jar org/apache/catalina/util/ServerInfo.properties
cd ..
rm -rf catalina
This workaround worked for me. I edited the serverInfo.properties file as given below:
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.
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
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 codeJust open the
ServerInfo.properties
file by opening thecatalina.jar
with winrar from your Tomcat's lib folderServerInfo.properties
file location incatalina.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
Restart your eclipse(if opened). Now it'll work...
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