• 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

Jdk1.5 configuration... .Please help

 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have installed jdk1.5 on my system and created a very simple java class but i am getting following error which compiling the class:

cannot access java.lang.Object,bad class file: C:\Program Files\Java\jdk1.5.0_05\jre\lib\rt.jar\java\lang\Object.class,class file has wrong version 49.0, should be 48.0

can anyone help on this???

thanks
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may have a JRE installed that is one generation behind your compiler. Run the command java -version and post the output here.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the output from java -version

"java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)"
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have Java 1.4 as well as 1.5 installed on your system (version 48.0 is the class file version number for Java 1.4 and 49.0 is for Java 1.5).

You are using the Java 1.4 runtime environment, and your system is configured wrong so that the Java 1.4 VM finds the classes of Java 1.5, which it cannot load.

Make sure you uninstall Java 1.4, so that you only have Java 1.5 on your system.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i cannot un install java 1.4 as i need it also.

I am using JBuilder and trying to compile that code from there. I have told it to use Jdk1.5 then why is it using jdk1.4?

Can i use both jdk1.4 and 1.5 at the same time ?

Thanks for replies
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be able to if you use the full path to all the commands such as java, javaw and javac.
I'm on Win98 and have been able to use either 1.4.2 or 1.5 by specifing the path to the exe file on the commandline. If you use the jre's java.exe from the Windows directory, it uses values from the Registry to test what version is in use and to find the path to the components it needs.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic