0

I followed the guide in HERE to install Tomcat 8.0.36 (binary version) on my El Capitan by downloading it from its website but it gives me error when I try to start it through terminal. Please help!

omnis-MacBook-Air:bin omni$ sudo ./startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.0.36-src
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.0.36-src
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.0.36-src/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Using CLASSPATH:       /usr/local/apache-tomcat-8.0.36-src/bin/bootstrap.jar:/usr/local/apache-tomcat-8.0.36-src/bin/tomcat-juli.jar
touch: /usr/local/apache-tomcat-8.0.36-src/logs/catalina.out: No such file or directory
/usr/local/apache-tomcat-8.0.36-src/bin/catalina.sh: line 429: /usr/local/apache-tomcat-8.0.36-src/logs/catalina.out: No such file or directory

UPDATE: I created a log folder in tomcat folder and now it says tomcat started but when I run localhost: 8080 it's not working (Site can't be reached)

omnis-MacBook-Air:bin omni$ ./startup.sh
Using CATALINA_BASE:   /usr/local/apache-tomcat-8.0.36-src
Using CATALINA_HOME:   /usr/local/apache-tomcat-8.0.36-src
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.0.36-src/temp
Using JRE_HOME:            /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Using CLASSPATH:       /usr/local/apache-tomcat-8.0.36-   src/bin/bootstrap.jar:/usr/local/apache-tomcat-8.0.36-src/bin/tomcat-juli.jar
Tomcat started.

Here's Catalina.out

Error: Could not find or load main class org.apache.catalina.startup.Bootstrap   
Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
7
  • I'm guessing that log directory doesn't exist. Maybe create it?? – Jeff Schaller Aug 30 '16 at 0:12
  • @JeffSchaller UPDATE: i created a log folder in tomcat folder and now it says tomcat started but when i run localhost: 8080 it's not working – Square-root Aug 30 '16 at 0:15
  • You'll have to give us more to work with than that. What's the error or output , and what's in the Catalina.out file? Edit it into the Q. – Jeff Schaller Aug 30 '16 at 0:17
  • it says This site can’t be reached in browser – Square-root Aug 30 '16 at 0:18
  • @JeffSchaller I uploaded errors – Square-root Aug 30 '16 at 0:38
0

I ran into the exact same problem today and found a way to fix it without having to download the binary distribution.

Assuming you followed the instructions in BUILDING.txt successfully, you only need to change the CATALINA_HOME to ${tomcat.source}/output/build and everything should work just fine.

In fact, there's a file called RUNNING.txt which specifically notes:

As an alternative to downloading a binary distribution, you can create your own from the Tomcat source code, as described in "BUILDING.txt". You can either

a) Do the full "release" build and find the created distribution in the "output/release" directory and then proceed with unpacking as above, or

b) Do a simple build and use the "output/build" directory as "CATALINA_HOME". Be warned that there are some differences between the contents of the "output/build" directory and a full "release" distribution.

The error "Could not find or load main class..." happens when CATALINA_HOME is set to ${tomcat.source} where there is no necessary generated classes. Those are stored under output/classes after building.

1

You accidentally downloaded source distribution according to your CATALINA_BASE variable (notice -src at the end of the path):

Using CATALINA_BASE: /usr/local/apache-tomcat-8.0.36-src

You should download the binary distribution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.