Install Tomcat with Eclipse
Howto install Tomcat with Eclipse IDE on MacOS X.
What we need:
Tomcat
Eclipse JEE
1. Extract Eclipse into your Applicationfolder and Tomcat to your prefered location for example into your home directory.
2. change into the apache-tomcat-6.0.20/bin directory and make all .sh files executeable
Double click on the server and select “Use Tomcat installation (take control of Tomcat installation)”:
6. Modify the tomcat-users.xml file located in /<pathtotomcat>/apache-tomcat-6.0.20/conf directory and add:
What we need:
Tomcat
Eclipse JEE
1. Extract Eclipse into your Applicationfolder and Tomcat to your prefered location for example into your home directory.
2. change into the apache-tomcat-6.0.20/bin directory and make all .sh files executeable
3. test if it startscd <pathtoyourtomcat>/apache-tomcat-6.0.20/bin chmod +x *.sh
something like this should appear:./setclasspath.sh ./startup.sh
./startup.sh4. Test you tomcat installation via your Browser
Using CATALINA_BASE: apache-tomcat-6.0.20
Using CATALINA_HOME: apache-tomcat-6.0.20
Using CATALINA_TMPDIR: apache-tomcat-6.0.20/temp
Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Home
if everything works like expected shut the tomcat instance downhttp://localhost:8080/
5. Now we add Tomcat to our Eclipse environment./shutdown.sh
Double click on the server and select “Use Tomcat installation (take control of Tomcat installation)”:
6. Modify the tomcat-users.xml file located in /<pathtotomcat>/apache-tomcat-6.0.20/conf directory and add:
<role rolename=”admin”/>with your username and password for administration.
<role rolename=”manager”/>
<user username=”user” password=”password” roles=”admin,manager”/>
INFO: Starting service Catalina
May 4, 2011 8:57:12 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
May 4, 2011 8:57:12 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler [\"http-bio-8080\"]
May 4, 2011 8:57:12 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler [\"ajp-bio-8009\"]
May 4, 2011 8:57:12 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 280 ms
Posted 05 May 2011 at 4:55 am ¶
I have the exact same problem! So frustrating. Have you figured any thing out?? Can’t seem to find any solutions!
Posted 19 May 2011 at 9:59 pm ¶
Posted 22 May 2011 at 12:14 pm ¶
Posted 29 Jun 2011 at 7:14 am ¶
I updated the tutorial you should see it in a screenshot above.
Regards,
Dominik
Posted 29 Jun 2011 at 7:25 pm ¶
Posted 06 Jul 2011 at 4:33 am ¶
Posted 25 Jul 2011 at 5:43 pm ¶
Posted 10 Aug 2011 at 6:03 pm ¶
I updated the tutorial you should see it in a screenshot above.
Regards,
Dominik”
Thanks, saved me some time and confusion! Only screener I can wee in the tutorial though!
I deleted server and created a new one, then I could change the server locations property.
/Peter
Posted 28 Aug 2011 at 11:37 am ¶
I’m new to Mac OS and need to use one of IDE with tomcat to create some servlets. I’ve installed Eclipse for EE Developers and tomcat 6.0.33 and have problems with this:
./setclasspath.sh
The BASEDIR environment variable is not defined
This environment variable is needed to run this program
what does it mean and what should I do, explain me please.
Thanx a lot!
Posted 15 Oct 2011 at 10:34 am ¶
how do you want to use the tomcat? Do you want to run it out of your IDE and deploy your servlets directly to it?
When did you get this message? When you run the script by your own?
Regards,
Dominik
Posted 15 Oct 2011 at 10:49 am ¶
I am having the same issue on Mac OSX.
I want to run tomcat through Eclipse using JEE. I’m fairly new to servlets/tomcat so don’t really know how else to explain. When I try to view localhost:8080 in the browser (after typing what Vitalii wrote and getting the same message, and then typing ./startup.sh and getting
“Using CATALINA_BASE: /Users/kirsty/Documents/apache-tomcat-6.0.33
Using CATALINA_HOME: /Users/kirsty/Documents/apache-tomcat-6.0.33
Using CATALINA_TMPDIR: /Users/kirsty/Documents/apache-tomcat-6.0.33/temp
Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
Using CLASSPATH: /Users/kirsty/Documents/apache-tomcat-6.0.33/bin/bootstrap.jar
touch: /Users/kirsty/Documents/apache-tomcat-6.0.33/logs/catalina.out: No such file or directory
/Users/kirsty/Documents/apache-tomcat-6.0.33/bin/catalina.sh: line 375: /Users/kirsty/Documents/apache-tomcat-6.0.33/logs/catalina.out: No such file or directory”)
I am not seeing anything but an error message in my browser.
Posted 03 Nov 2011 at 2:03 am ¶
For me there is a line in you post you should have a closer look: touch: /Users/kirsty/Documents/apache-tomcat-6.0.33/logs/catalina.out: No such file or directory
The startup procedure should create this file. Are you allowed to write in this folder?
And after your tomcat is working from a terminal you should make the connection between your IDE and the tomcat server.
Regards,
Dominik
Posted 07 Nov 2011 at 6:13 pm ¶
if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then
To work around the issue, I simply set BASEPATH to my tomcat directory before running the other two steps. I put Tomcat in my home directory so I did this:
export BASEDIR=”/Users/my_user_name/apache-tomcat-6.0.33″
Then ran the setclasspath.sh and startup.sh scripts. It worked.
Following the rest of the instructions, I’m also able to start and stop the server with Eclipse.
But, I do get a 404 when visiting http://localhost:8080/ when I start the sever with Eclipse. I think this is normal. When I hit a URL for a web app I’m working on in Eclipse, ex: http://localhost:8080/MyBasicWebApp/ it works.
Thank you Banym for these excellent instructions!
Cheers,
David
Posted 03 Dec 2011 at 8:58 pm ¶
Please assist me asap.
Posted 24 Jan 2012 at 5:53 pm ¶
check your max memory values you are using for your java, eclise and tomcat. There you can increase the max memory. If you change your classes you maybe need to redeploy your application that’s maybe the cause of the crash if you have tomcat up and running while you’re changing the code.
Regards,
Dominik
Posted 25 Jan 2012 at 11:44 am ¶
Posted 10 Mar 2012 at 1:47 pm ¶
“Set deploy path to the default value (current set)” – If the Tomcat main screen does not appear that this path will need to be set to theTomcat’s web apps folder.
Posted 15 Apr 2012 at 3:35 pm ¶