• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem regarding the .class version

 
Ranch Hand
Posts: 55
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic