1

I know this question was asked so many times but I never found an answer that relates to my question. I am trying to install Apache Tomcat server on my MacBook Pro. All answers were answered for Windows and Eclipse. I want to install and configure the server using Terminal. So the problem is happening at the last step of the installation. I am getting the below error while installing the server. I know this is a problem is about Java version at run time, but I can't fix it. Note: I have already updated my Java version to the latest one. Please help.

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 51.0

    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Community
  • 1
  • 1
Jack
  • 258
  • 2
  • 7
  • 15

2 Answers2

4

You say you've got the latest version, but then you also say you're using Java 1.6_051. That is not the latest version of Java.

You need Java 7 - see this page for how to install Java 7 on Mac OSX.

If you can't install Java 7 on your machine for some reason, you'll need to use a different version of Tomcat. Tomcat 8 requires Java 7, as shown on the "which version" Tomcat page. You might also wish to consider using an older version of Tomcat anyway, given that Tomcat 8.0 is still only at RC-1 level - I would typically stick with a stable version unless you're willing to take on the pain of pre-releases.

Jon Skeet
  • 1,335,956
  • 823
  • 8,931
  • 9,049
-1

For Tomcat 8 Any installed Java 7 or later JRE (32-bit or 64-bit) may be used.

Please read the requirements

http://tomcat.apache.org/tomcat-8.0-doc/setup.html

Prabhakaran Ramaswamy
  • 24,936
  • 10
  • 54
  • 63
  • I actually did and I mentioned that I did the update for the latest version for Java. Please read what I have said before answering questions. Thanks – Jack Aug 24 '13 at 07:54