tags:

views:

6856

answers:

7

Eclipse doesn't allow me to create web application while configuring Tomcat 6. It asked to set the Tomcat installation folder, if i set "/usr/share/tomcat6" then it shows "The Tomcat installation directory is not valid. It is missing expected file or folder conf.", if i set "/var/lib/tomcat6" then it shows "The Tomcat installation directory is not valid. It is missing expected file or folder lib/jasper-el.jar."

How to configure Eclipse with Tomcat6 in ubuntu

A: 

I'd download separate tomcat for development purposes from here - or there is a feature that downloads server distrubution directly from Eclipse (don't know if you have it installed). All Eclipse needs is a folder containing unpacked tomcat distro. I see no point in using ubuntu packaged tomcat for development.

schmeedy
+6  A: 

I experienced this same problem on Ubuntu Linux. Open a terminal window and type this in:

cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf

In the Eclipse configuration window it should immediately recognize this as a viable directory. I'm not exactly sure why the Tomcat installation splits the bin and conf directories but apparently Eclipse thinks they're supposed to be next to each other.

Hunter D
A: 

@schmeedy: How about "to get as close to your production version/environment as possible"?

Jaroslav Záruba
A: 

In Ubuntu 10.04, the Ubuntu repositories work easiest if you create a symbolic link for the conf folder and make sure you give generous permissions for the tomcat6 related files

cd /usr/share/tomcat6 sudo ln -s /var/lib/tomcat6/conf conf

then

sudo chmod 777 /usr/share/tomcat6 * -R

After installing the j2ee related eclipse packages I was able to find the server wizard and specify the /usr/share/tomcat6 successfully.

If Eclipse gets fussy, switch to a new workspace and try the wizard again until you get it right.

Joe Olstad
A: 

Or even better,

cd /home/username/Desktop
wget http://mirrors.axint.net/apache//tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
tar xzvf apache-tomcat-6.0.29.tar.gz
cd /usr/share/tomcat6
sudo mkdir conf
cd /usr/share/tomcat6/conf
sudo cp /home/username/Desktop/apache-tomcat-6.0.29/conf/* .

This is how it worked for me :)

Anand
A: 

As told in the first answer, i created a link for conf folder in /usr/share/tomcat6 folder.

cd /usr/share/tomcat6

sudo ln -s /var/lib/tomcat6/conf conf

Then I copied all the policy files in /etc/tomcat6/policy.d folder in to /etc/tomcat6. Removed the 01,02... prefix in each policy file. And given the read and execute permission on all the files (sudo chmod 755 *.policy). Then removed the existing workspace. Set up new workspace for Eclipse and configured the server again. It worked. Before starting the server in Eclipse it is essential to stop the currently running tomcat instance. It can be done by running the shutdown script (sudo /usr/share/tomcat6/bin/shutdown.sh)

learningloop