8

I am a newbie, so you might have to simplify explanation for me. On my command line it says tomcat started. But when I try to go to my browser and type 'Http://localhost:8080' it says failed to open page.

In the Tomcat log I got this error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
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)

FYI

java version "1.8.0_60"

Java(TM) SE Runtime Environment (build 1.8.0_60-b27)

Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

I have download the latest tomcat version. I am using NetBeans

I have two netbeans one was standard edition that I added the EE plugin (don't know if this has any relevance), the other netbean is download as the EE. Why because I don't know what I am doing and mac doesn't allow me to delete and I don't want to use the command line to this because again I don't know what I am doing.

I have been spending a lot of time on this and I am assuming it has something to do with either JAVA_HOME or the version of the JDK. If that is the case please I need instruction on how to do this. I have been trying to instal maven and tomcat for 2 days now.

**This might help also when I try to run a project on netbeans it says:

NetBeans: No suitable Deployment Server is defined for the project or globally.

Things I have don't but don't know why: Inside my catalina.sh I have written this:

#!/bin/sh JAVA_HOME=/usr/local/apache-tomcat-9.0.0.M1/bin

On my command line LASTLY I have written this:

timurs-MacBook-Air:~ timur$ export PATH=$JAVA_HOME/bin:$PATH

This is tomcat Version info:

timurs-MacBook-Air:~ timur$ /usr/local/apache-tomcat-9.0.0.M1/bin/catalina.sh version
Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.0.M1
Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.0.M1
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.0.M1/temp
Using JRE_HOME:        /Library/Java/Home
Using CLASSPATH:       /usr/local/apache-tomcat-

9.0.0.M1/bin/bootstrap.jar:/usr/local/apache
-tomcat-9.0.0.M1/bin/tomcat-juli.jar
0xtimur
  • 1,163
  • 3
  • 10
  • 16
  • What exactly are you trying to do when you get this error on the console and the " failed to open page" notification? Are you trying to access the tomcat homepage at `http://localhost:/` or some custom application? – Andrew Tomlinson Dec 18 '15 at 23:24
  • Yes I am trying to access the tomcat homage at http://localhost:/ – 0xtimur Dec 19 '15 at 00:31
  • When I wrote 'Http://localhost:8080' it just removed it on the original post, now I have edit the post and put it inside of code tags and now its displaying – 0xtimur Dec 19 '15 at 00:39
  • Are you sure tomcat is using Java 1.8? – Henry Dec 19 '15 at 10:09
  • I wrote it on the post it looks cleaner up there – 0xtimur Dec 19 '15 at 11:40
  • I have already been there before but since I am newbie like I wrote, perhaps things go over my head. Like I said this is my third day trying to do this. – 0xtimur Dec 19 '15 at 12:20
  • In addition if you read my post properly you will see that I wrote that It might be a version issue and I was asking for instructions on how to exactly since I am newbie – 0xtimur Dec 19 '15 at 12:43

1 Answers1

9
  • java.lang.UnsupportedClassVersionError happens because of a higher
    JDK during compile time and lower JDK during runtime.

  • If you are using eclipse do the following go to menu command Window -> Preferences -> Java -> Compiler and then set "Compiler compliance level" to 1.8

  • Make sure JRE_HOME is set to 1.8
Ritesh Karwa
  • 2,196
  • 1
  • 13
  • 17