Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

java - Can't fix Unsupported major.minor version 52.0 even after fixing compatibility

When I try running my java .jar on another machine I get the error

Unsupported major.minor version 52.0

I compiled my program using the jdk 1.6 and my machine (separate one) has java 7 installed.

This is the java version my machine is running:

java version 1.7

Here are the settings in my IDE (Eclipse Lunar)

eclipse compiler settings

eclipse JRE settings

Why am I still getting an unsupported error?

I did check my run configuration and change it to jre6, but when I do I can't even run my program in the IDE.

Note: I would like my program to work with jdk 6, if that is not possible jdk 7.

My Class Path:

class path

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I agree with chrylis: you believe you changed your project's compliance settings but probably you didnt.

Right click on your project and:

  • Java / Build Path : Go to Libraries tab and ensure yourself that you are really using jre6
  • Java / Compiler : Ensure yourself that you have selected 1.6 compliance

By the way you can "tell" eclipse that jre8 is 1.6 compliance clicking on Window/Preferences/Java/Installed JREs/Execution Environment and selecting in the left panel, Execution Environments, JavaSE-1.6 and in the Compatible JRE's panel, jre8


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...