• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem regarding the .class version

 
ilias basha
Ranch Hand
Posts: 55
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i am building the java project with jre 1.4.2 in windows machine
and porting the jar(java project) into solaris environment where the jdk 1.4.2_19 is installed,
i need to refer this jar file while compiling some other java code, and i am getting the following error in solaris machine( jdk 1.4.2_19 ).

BandData.java:19: cannot access com.servion.BandingApp
bad class file: /usr/appn/HDFC/BandingApp.jar(com/servion/BandingApp.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
import com.servion.BandingApp;
^
1 error
JAVA CODE IS COMPILED
Exception in thread "main" java.lang.ClassFormatError: The major.minor version '
49.0' is too recent for this tool to understand.
at sun.tools.java.BinaryClass.load(BinaryClass.java:105)
at sun.tools.java.BinaryClass.load(BinaryClass.java:85)
at com.sun.tools.javah.oldjavah.JavahEnvironment.getClass(JavahEnvironme
nt.java:172)
at com.sun.tools.javah.oldjavah.JavahEnvironment.getAllFields(JavahEnvir
onment.java:89)
at com.sun.tools.javah.oldjavah.JNI.write(JNI.java:38)
at com.sun.tools.javah.oldjavah.Gen.run(Gen.java:149)
at com.sun.tools.javah.oldjavah.Main.run(Main.java:174)
at com.sun.tools.javah.oldjavah.Main.main(Main.java:41)
at com.sun.tools.javah.Main.main(Main.java:40)

can anybody help me regarding this.
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting.
How are you building your jar? Command line? Ant? IDE? How are you confirming which JDK is being used? (In Eclipse, for e.g. if you have multiple JDKs installed on your machine you can configure which JDK to use).
What do you get when you run java -version from the command line on your Windows ?
 
ilias basha
Ranch Hand
Posts: 55
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i am using eclipse and i configured the project with jdk 1.4.2.


Sorry to waste your time, actually i forgot to configure java compiler option in eclipse - java compiler compilance level to 1.5

so i was facing the problem, but which i set it to 1.4 and the application is working fine.


Anyways
Thanks
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ilias basha wrote:
Sorry to waste your time, actually i forgot to configure java compiler option in eclipse - java compiler compilance level to 1.5


No problem. Happens
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic