Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling java file with JRE 1.5.0_22, but the output class shows version 1.6 : 50.0, super bit ?

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm surprised to find out in eclipse where setup library is JRE 1.5.0_22, but the output compiled class shows version version 1.6 : 50.0, super bit? . Any clue?

Now if I run the class with JRE 1.5.0_22, it will give me error obviously-
java.lang.UnsupportedClassVersionError: Bad version number in .class file

Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not compiling anything with JRE 1.5.0_22 - the JRE doesn't contain a Java compiler. You need a JDK for compiling Java source code.

And Eclipse doesn't even use the Java compiler from the JDK; it has its own built-in Java compiler.

Somewhere in your project configuration you should be able to specify what version the produced class files should be compatible with. Have a look at your project configuration.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks


back to basics

I did changed the configuration here-

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic