Unknown version of Tomcat was specified in Eclipse

I want to add latest tomcat-7.0.42 in my eclipse. Probably eclipse tomcat server adapter 7 only supports tomcat version upto 7.0.12 ..

enter image description here

So please help me how can I configure my eclipse with tomcat-7.0.42

160811 次浏览

You are specifying tomcat source directory.

You need to specify tomcat binary installation root directory, also known as CATALINA_HOME.

Usually, this is where you untar apache-tomcat-7.0.42.tar.gz file.

Probably, you are trying to point the tomcat directory having the source folder. Please download the tomcat binary version from here .For Linux environments, there you can find .zip and .tar.gz files under core section. Please download and extract them. after that, if you point this extracted directory, eclipse will be able to identify the tomcat version. Eclipse was not able to find the version of tomcat, since the directory you pointed out didn't contain the conf folder. Hope this helps!

This happened to me because Tomcat was still in the process of downloading (Download and Install). The message disappeared after a few minutes.

The eclipse window should really have some type of progress indicator showing download status.

As soon as you provide the directory where Tomcat needs to be installed and click ok you can notice download and installation starts in the progress tab of Eclipse.

enter image description here

Let the process complete.The error will automatically disappear.

enter image description here

Note: It is not mandatory to name your folder CATALINA_HOME. I have tested this with windows. Cannot assert the same for Linux but IMO same rule should apply.

For LINUX the installation directory for Tomcat 7 is: /usr/share/tomcat7

Please use this configuration.

More here: http://gridlab.dimes.unical.it/lackovic/eclipse-tomcat-ubuntu-jersey/

Go to "Window -> preferences -> Server -> Runtime Environments"

Remove the existing servers they might not have downloaded completely.

Add new Server

To recognise your Tomcat installation folder, Eclipse is scanning for the following files:

conf/catalina.policy
conf/server.xml
conf/web.xml
conf/context.xml
conf/tomcat-users.xml
conf/catalina.policy
conf/catalina.properties
lib/catalina.jar

so make sure you're pointing to the right place and have the right read permissions.

E.g.

For Windows Users,

Use the Tomcat Service Installer from the Apache tomcat downloads page. You will get a .exe file. which Installs the service for windows. It will usually install Apache tomcat at "C:\Program Files\Apache Software Foundation\Tomcat 8.0" and its easily recognized in eclipse.

Just in case... Apache Tomcat 8.5.X is not compatible with Apache Tomcat 8.0 server selection in eclipse. And it gives this error.

You are pointing to the source directory. You can run a build by running ant from that same directory, then add '\output\build' to the end of the installation directory path.

I got the same error and resolved it by giving enough permissions to the folder. I gave full permissions by (you can try limited permissions which is enough for eclipse to run tomcat)

sudo chmod -R 777 apache-tomcat-8.5.33/

FYI, I encountered this error on my mac, but I think it should be same for ubuntu system too.

Having installed tomcat with brew the solution for me was:

sudo chmod -R 777 /usr/local/Cellar/tomcat/<your_version>

I am on MacOS and installed tomcat using homebrew, Following path fixed my problem

/usr/local/Cellar/tomcat/9.0.14/libexec

It may be due to the access of the tomcat installation path(C:\Program Files\Apache Software Foundation\Tomcat 9.0) wasn't available with the current user.

In my case I used wrong directory, the right one is lib exec and my path: /usr/local/Cellar/tomcat@7/7.0.96/libexec

I know this is and oldie but i had this issue recently with the latest versions of Tomcat and Eclipse on Windows 10.

It was a permissions issue. All i had to do was navigate to the Tomcat install directory and open the folder. I was prompted to access the folder as an Administrator.

After this the versions were recognised by Eclipse and I could add the new runtime.

Since this is evidently happening on Linux, this would be because your dev user might not have read access to Tomcat's installation directory. That's because Tomcat's installation directory (let's say it is pointed to by CATALINA_HOME) is owned by tomcat:tomcat while your dev user is something that's neither tomcat nor one that belongs to the tomcat group. Therefore Eclipse fails to read ${CATALINA_HOME}/conf/catalina.policy.

The following should fix the permission issue:

sudo find ${CATALINA_HOME} -type d -exec chmod o+rx {} \;

Why do we need the execute bits? Because to traverse a directory and reach its descendants, you need execute permissions. In your case, if CATALINA_HOME isn't yet set, replace the actual installation directory (/opt/tomcat/apache-tomcat-<version> maybe?) in the above.