Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Tomcat 8.5.20
  • Eclipse Java EE IDE for Web Developers (4.7.0)
  • Ubuntu 17.04

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
like image 523
Evgenij Reznik Avatar asked Dec 24 '22 15:12

Evgenij Reznik


2 Answers

You just need to give permission

chmod -R 777 /opt/tomcat/
like image 96
Jose N Avatar answered Dec 26 '22 05:12

Jose N


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.

like image 32
nitind Avatar answered Dec 26 '22 05:12

nitind