Archive for June, 2013

Configure Tomcat 7 & Eclipse on Ubuntu

June 28th, 2013

Install Eclispe

Either via sudo apt-get install eclipse and then install Web Tools Platform for JavaEE, or download Eclipse for JavaEE.

Install tomcat

We can also install tomcat in 2 ways:
1. sudo apt-get tomcat7
2. download tomcat7 and extract it into folder, such as ~/Prog/tomcat

Integrate Eclipse and Tomcat

When I run the project with “Run On Server” and follow the instruction of “Define a new server” with tomcat v7, I always get this error message: “Cannot create a server using the selected type”. Well, here is the solution: http://oramirez.wordpress.com/2012/02/03/eclipse-with-tomcat-v7-0-in-ubuntu-11-10/.

And then somehow I encounter this error: Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete., and http://www.jusuchyne.com/codingchyne/2010/10/installing-tomcat-7-on-ubuntu/ tells that it’s because eclipse failed to copy the conf files into eclipse tomcat conf. so:
1. first sudo chmod -R 777 ~/Prog/tomcat7/conf;
2. and delete the server in Eclipse Perferences -> Server -> Runtime Environment, re-add it;
3. and then re-define the server at “Run on Server”.