'Tomcat installation issue - "Could not find or load main class"

I want to create a 'Dynamic web project' in eclipse. To do so, I want Tomcat to be listed in 'Target runtime' combo. So, I'm trying to install Tomcat. I changed the mode of all .sh files in TOMCAT_HOME/bin as follows;

  1. [root@localhost opt]# cd apache-tomcat-7.0.12/bin/
  2. [root@localhost bin]# chmod 0755 *.sh

I could see that there is a problem with my installation. How to resolve the below errors and install tomcat successfully?

On executing ./version.sh command, I get the following

Using CATALINA_BASE:   /home/admin/apache-tomcat-9.0.0.M6-src
Using CATALINA_HOME:   /home/admin/apache-tomcat-9.0.0.M6-src
Using CATALINA_TMPDIR: /home/admin/apache-tomcat-9.0.0.M6-src/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_91
Using CLASSPATH:       /home/admin/apache-tomcat-9.0.0.M6-src/bin/bootstrap.jar:/home/admin/apache-tomcat-9.0.0.M6-src/bin/tomcat-juli.jar

Error: Could not find or load main class org.apache.catalina.util.ServerInfo

On executing ./configtest.sh, I get the following error;

Using CATALINA_BASE:   /home/admin/apache-tomcat-9.0.0.M6-src
Using CATALINA_HOME:   /home/admin/apache-tomcat-9.0.0.M6-src
Using CATALINA_TMPDIR: /home/admin/apache-tomcat-9.0.0.M6-src/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_91
Using CLASSPATH:       /home/admin/apache-tomcat-9.0.0.M6-src/bin/bootstrap.jar:/home/admin/apache-tomcat-9.0.0.M6-src/bin/tomcat-juli.jar

Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
Configuration error detected!


Solution 1:[1]

Look at this evidence you gave us on the question:

Using CATALINA_BASE:   /home/admin/apache-tomcat-9.0.0.M6-src

The "-src" means that you have downloaded the source code which requires to be built.

Download the "bin distribution", for example the first file on the "Core" section in this link https://tomcat.apache.org/download-80.cgi

Now it will run. Anyway, refer to the RUNNING.txt file on the main installation folder and you will be fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Juliano Suman Curti