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

8

30

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?

Unstriped answered 24/6, 2015 at 14:48 Comment(3)
It may help to provide a little more context. How are you trying to launch Tomcat? How did you configure Eclipse? How did you install Tomcat?Overthecounter
This answer might be helpful #1392883Sather
Please provide some additional information like your app code, how did you added tomcat in eclipse IDE etc.Aquitaine
I
12

It seems the server does not have access to two Jar files.

  • Go to Servers Tab > Double Click on your Server > Open Launch Configuration > Classpath(tab) > Click on User Entries > Add External Jars > Add Boorstrap.jar and tomcat-juli.jar > Apply > Ok

Start the server now.

Iinden answered 24/6, 2021 at 14:36 Comment(0)
F
8

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
Fenderson answered 18/11, 2015 at 18:12 Comment(0)
L
1

Simply changing the perspective from java to java EE on the top right corner did the trick for me. If you cannot find java EE their simply click on the other perspective icon and add java EE from there.

If this doesn't work try using different versions of jdk in your project, i changed my jdk from 11 to 1.8 and the project started running.

Lias answered 26/11, 2021 at 10:42 Comment(0)
S
0

Que 1. Is your tomcat started interdependently(outside eclipse)??

Ans. if ans is no - then - I think you have downloaded tomcat source instead binary... you should download binary and install tomcat then it will run.

1.download binary (https://tomcat.apache.org/) 2.unzip it

3.copy unzipped apache folder

4.place this to your program files

  1. set JAVA_HOME to C:\Program Files\Java\jdk_Your_version_num

  2. Run C:\Program Files\apache-tomcat-Your_version_num\bin\startup.bat .... hope your tomcat will start

1.download binary Link -. https://tomcat.apache.org/

1.1. choose version of your choice and click "download"

1.2. On next page under heading "Binary Distributions"- download zip and proceed to next steps. All the best.

Stoical answered 20/4, 2018 at 7:43 Comment(0)
L
0

If tomcat is working perfectly fine independently,

  • then change the permissions of the directory and subdirectories of tomcat

Eclipse is not able to read a certain file from the directory which is the reason for the error. Nothing worked for me, but changing the permission helped me.

Lesbianism answered 23/2, 2019 at 18:8 Comment(0)
I
0

If Tomcat works fine independently, close Eclipse and then right click Eclipse and choose 'Run as an administrator'.

That worked for me in Windows 10 with Eclipse Version: 2021-06 (4.20.0) and Tomcat 10.0.20

Immedicable answered 7/9, 2022 at 12:56 Comment(0)
N
0

Had the same issue on MacOS. Turns out the issue had to do with the name of the directory that I had both Tomcat and Eclipse in. My directory was titled "23-24" This gets automatically translated to 23:24 in Eclipse when choosing a work directory. Tomcat however does not like semicolon characters so it would not start the server. I figured this out by trying to run Tomcat by itself and getting an error in terminal saying that CATALINA_HOME contained a : which it shouldn't. I changed the name of my directory to include no "-" characters and no spaces and it seemed to have fixed this issue for me.

Namecalling answered 26/9, 2023 at 18:30 Comment(0)
P
-1

most likely cause it tomcat cannot run bootstrap.jar this is due to bad jre you can choose with jre tomcat has to use by running ConfigureTomcat tool and choosing a different \jre\bin\server\jvm.dll

Preemption answered 19/1, 2023 at 18:13 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Confabulation

© 2022 - 2025 — McMap. All rights reserved.