Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find or load main class org.apache.catalina.startup.Bootstrap

Tags:

When I run apache tomcat7.0.56 in Eclipse, I get an error

Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

How can I fix the problem?

like image 290
Nitesh Kataria Avatar asked Jun 24 '15 14:06

Nitesh Kataria


1 Answers

First of all you should try to run TOMCAT using it's own .bat and not Eclipse. If it doesn't run problems would be on your tomcat installation and not in Eclipse and you could take a look to the files of TOMCAT_HOME/logs/ where Tomcat's errors are traced (they are so helpful).

Anyway, if it runs properly out of eclipse, try to delete the eclipse's tomcat configuration and set it from the beginning following these simple steps

  • Go to Eclipse's Window > Preferences > Server > Runtime Environment and add a Tomcat Server browsing your TOMCAT_HOME and selecting the suitable JRE (use JAVA_HOME that contains jre yet) paying attention to messages requiring a certain JDK depending on the TOMCAT version (TOMCAT_8 requires at least JDK_1.7 version and, if not set, usually shows errors explaining it when starting)
  • Go to Eclipse's Window > Show View > Other... > Server > Servers and add a new server; in this case the version of TOMCAT you set before. You don't need to add further configuration to make TOMCAT to start.
  • At this point if would be helpful if you hadn't any app at TOMCAT_HOME's webapps folder but those that came default (you must empty TOMCAT_HOME/work folder to remove cached stuff). Once you have ensured it, start from ECLIPSE and cross fingers. In case of fail, take a look to Eclipse's console and look for the exception to copy at this post
like image 97
Facepalmed Avatar answered Sep 20 '22 16:09

Facepalmed