6

I have by default TOMCAT installed in my system which I can start/stop from terminal using:

sudo /etc/init.d/tomcat7 start
sudo /etc/init.d/tomcat7 stop

But unfortunately I can't configure the same in Eclipse.

I have tried all possibilities of directing the Apache Tomcat v7.0 in the Tomcat Installation directory (Window→Preferences→Server→Runtime Environment→Add→Tomcat7) but still getting this notification: "Unknown version of Tomcat was specified."

Can anyone help me with Tomcat configuration for Eclipse (without re-installing another server).

Eliah Kagan
  • 119,640

3 Answers3

3

Even though its late, I'm posting this for future readers. I found out there is an easy way of doing that. You can follow this blog post which is providing a step by step guide to do it: Install Apache Tomcat on Ubuntu

Step 1: Open the Eclipse.

Step 2: Goto Windows → Preferences in the menu bar and select the Runtime Environments under the Server.

enter image description here

Step 3: Click on the 'Add' button.

Step 4: Select your Apache Tomcat version under the 'Apache' root and click 'Next'.

enter image description here

Step 5: Browse and select the Tomcat installation directory.

enter image description here

Step 6: Click on the 'Finish' button

Step 7: Click on the 'OK' button to close the Preferences dialog.

enter image description here

1

In Ubuntu, the application doesn't have default permission to read/edit all the folders.

Change the permission for tomcat to 755 and it will work.

sudo chmod -R 755 /opt/tomcat/apache-tomcat-9.0.24/
1

You are specifying tomcat source directory but it needs to specify tomcat binary installation root directory, also known as CATALINA_HOME.

You can download apache-tomcat and untar it there or add a links.

If you untar apache-tomcat in /opt/apache-tomcat-7 you can create symbolic links to its folders.

/etc/tomcat/tomcat7$ ln -s /opt/apache-tomcat-7/conf conf
/etc/tomcat/tomcat7$ ln -s /opt/apache-tomcat-7/lib lib
/etc/tomcat/tomcat7$ ln -s /opt/apache-tomcat-7/logs logs
/etc/tomcat/tomcat7$ ln -s /opt/apache-tomcat-7/webapps webapps
/etc/tomcat/tomcat7$ ln -s /opt/apache-tomcat-7/work work

I hope this helps!

Joe
  • 929