Java unsupported major minor version 52.0 [duplicate]
Asked Answered
B

4

81

I can not launch my java application as a web applet in HTML (I am using HTML 4.01, I know it doesn't work in html5). The error message it returns is:

java : Unsupported major.minor version 52.0

I have tried downgrading my java JRE/JDK/SDK but I still get the same error message. The current version of java I am now using is 1.8.0_05.

Bouffant answered 23/4, 2014 at 15:46 Comment(10)
Look at the loooooong list of related questions on the right.Milli
that is the 51.0 version, and I have tried the solutionsBouffant
You must compile for an old version of the JRE, the one you run in your browser. This is done by using the target parameter. See docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/…Vertievertiginous
I will take a look at that nowBouffant
I cant seem to -target the JRE like you said it seems to want the sdkBouffant
You current version is almost certainly not 1.8.0_05. Try javatester.org/version.htmlCradling
when I type in java -version into cmd thats what it comes out withBouffant
Maybe it is a duplicate, but searching for the 52.0 message error take me here.Kingsly
Simply set your environment variable Java home to the new version of java.. that solves the probelmLeastwise
Consider accepting the top answer. Even though this is a dup you can check it off if it was helpful.Winterize
S
109

Your code was compiled with Java Version 1.8 while it is being executed with Java Version 1.7 or below.

In your case it seems that two different Java installations are used, the newer to compile and the older to execute your code.

Try recompiling your code with Java 1.7 or upgrade your Java Plugin.

Surfacetosurface answered 23/4, 2014 at 16:9 Comment(4)
I have done all of that and now the error is "java.lang.reflect.InvocationTargetException"Bouffant
I had this problem when using the Stanford Parser jars. Thanks @LeonardPrinting
Linux/Mac check echo $JAVA_HOME if it's not pointing to Java 7 folderDruggist
For Windows use this echo %JAVA_HOME% to check for Java_Home path.Mattson
W
7

You have to compile with Java 1.7. But if you have *.jsp files, you should also completely remove Java 1.8 from the system. If you use Mac, here is how you can do it.

Wildawildcat answered 8/8, 2014 at 17:29 Comment(0)
F
2

I noticed that in netbeans Apache configuration in the servers tab. you can state the platform for your web application. I changed to 1.8 and it worked fine. (I am targeting java 8 platform in my application). Hope that might t help.

Feather answered 3/6, 2014 at 15:29 Comment(0)
H
2

I assumed openjdk8 would work with tomcat8 but I had to remove it and keep openjdk7 only, this fixed the issue in my case. I really don't know why or if there is something else I could have done.

Henleigh answered 17/9, 2014 at 3:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.