Evgenij Reznik
Evgenij Reznik

Reputation: 18614

Setting up Tomcat in Eclipse on Ubuntu

I'm trying to setup Tomcat in Eclipse. I've already followed this tutorial on how to install Tomcat and I'm even able to see the default Tomcat page at localhost:8080.

What I need now is to setup Tomcat on Eclipse.

I do the following:

Window->Preferences->Server->Runtime Environment->Add->"Apache Tomcat v8.5"

As Tomcat's installation directory I enter /opt/tomcat, as specified in the tutorial linked above in Step 3: Install Tomcat:

We will install Tomcat to the /opt/tomcat directory. Create the directory, then extract the archive to it [...]

But I get the following error:

Unknown version of Tomcat was specified.

As can be seen here:

enter image description here

Some more infos:


Update:

When I check the permission with ls -ltra /opt/tomcat I get that output:

total 124
drwxr-x---  7 tomcat tomcat  4096 Aug  2 23:36 webapps
-rw-r-----  1 tomcat tomcat 15946 Aug  2 23:36 RUNNING.txt
-rw-r-----  1 tomcat tomcat  7064 Aug  2 23:36 RELEASE-NOTES
-rw-r-----  1 tomcat tomcat  1723 Aug  2 23:36 NOTICE
-rw-r-----  1 tomcat tomcat 57092 Aug  2 23:36 LICENSE
drwxr-xr-x  6 root   root    4096 Aug 11 17:56 ..
drwxr-x---  2 tomcat tomcat  4096 Aug 11 17:56 lib
drwxr-x---  2 tomcat tomcat  4096 Aug 11 17:56 bin
drwxr-x---  2 tomcat tomcat  4096 Aug 12 14:53 .oracle_jre_usage
drwxr-xr-x 10 tomcat tomcat  4096 Aug 12 14:53 .
drwxr-x---  3 tomcat tomcat  4096 Aug 12 14:53 work
drwxr-x---  3 tomcat tomcat  4096 Aug 12 15:01 conf
drwxr-x---  2 tomcat tomcat  4096 Aug 14 17:21 temp
drwxr-x---  2 tomcat tomcat  4096 Aug 14 17:21 logs

Upvotes: 5

Views: 10429

Answers (3)

Jose N
Jose N

Reputation: 151

You just need to give permission

chmod -R 777 /opt/tomcat/

Upvotes: 6

nitind
nitind

Reputation: 20013

You really don't want Eclipse and a production installation of Tomcat to mix. The most straightforward thing to do is to download a tarball from http://tomcat.apache.org/ , unpack it, and point the Server->Runtime Environments preference page at that. This lets you sidestep any file permission issues as long as your make sure that they don't try to use the same ports.

Upvotes: 5

Momus
Momus

Reputation: 394

Open the Servers view and add the Tomcat server:

Window > Show View > Servers

In the Server view right click and select

New > Server

Now you'll get a window that looks like the one below. Open the Apache tab and scroll down to Tomcat 8.5 click on it and then click Next.

Add a new server in eclipse

In the next window you will be asked to select resources that are configured on the server. If you don't see any it means you will need to go to your project and add Dynamic Web Module facet. This can be done as follows:

Properties > Project Facets

Add facet to project

At this point you should be able to start the server and run your project using the controls in the top right of the Servers view, or by right clicking on the specific server. You can add several installations of Jetty, Tomcat, Resin, JBoss, etc if you need them by the way.

Upvotes: 0

Related Questions