java - Unsupported major.minor version 52.0 -
this question has answer here:
pictures:
command prompt showing versions
picture of error
hello.java
import java.applet.applet; import java.awt.*; public class hello extends applet { // java applet draw "hello world" public void paint (graphics page) { page.drawstring ("hello world!", 50, 50); } }
hello.html
<html> <head> <title>helloworld applet</title> </head> <body> <applet code="hello.class" width=300 height=150> </applet> </body> </html>
error
hello : unsupported major.minor version 52.0
what may problem be?
the issue because of java version mismatch. referring wikipedia java class reference :
- j2se 9 = 53
- j2se 8 = 52
- j2se 7 = 51
- j2se 6.0 = 50
- j2se 5.0 = 49
- jdk 1.4 = 48
- jdk 1.3 = 47
- jdk 1.2 = 46
- jdk 1.1 = 45
these assigned major numbers. error regarding unsupported major.minor version because during compile time using higher jdk , lower jdk during runtime.
thus, 'major.minor version 52.0' error possibly because jar compiled in jdk 1.8, trying run using jdk 1.7 environment. reported number required number, not number using. solve this, it's better have jdk , jre pointed same version.
in intellij,
- go maven settings -> maven -> importing. set jdk importer 1.8
- go maven settings -> maven -> runner. set jre 1.8
- go file -> project structure -> sdks. make sure jdk home path set 1.8
restart intellij
another approach might instructing idea jdk version start with.
go : /applications/intellij\ idea\ 15\ ce.app/contents/info.plist , replace jvm version :
<key>jvmversion</key> <string>1.8*</string>
Comments
Post a Comment