This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wierd Error

 
Shivit Agarwal
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have been running java for a month. Yesterday after installing Oracle 10g and Microsoft Visual Studio6.0, i am now only able to compile the file but run.
While running, it flag as an error stating
" java.lang.UnsupportedClassVersionError" ..................

How to resolve the thing ??
[ April 11, 2008: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refrain from using words such as "Urgent!" when posting. Your question is no more and no less important than anyone else's. In fact, by using the such terms, you you can delay or prevent useful response to your question. Please read this to find out why.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That usually means you are using an older java program than the javac program you compiled your code with.

Other people on this forum have said that Oracle installs its own Java runtime, which has presuambly overwritten your runtime. I did a search of this forum and found this and this. I hope that is of help.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle comes with its own old version of a JRE. Try editing your PATH variable to remove the path for the Oracle JRE and make sure there is a path to your correct JRE.

See step 4 of Sun's installation instructions for Windows. (These are for Java 1.6. You might need to adjust depending on your version.)
 
Shivit Agarwal
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Please refrain from using words such as "Urgent!" when posting. Your question is no more and no less important than anyone else's. In fact, by using the such terms, you you can delay or prevent useful response to your question. Please read this to find out why.


Sorry if I abused the term "urgent" unknowingly, but all my work is now a day behind for this so it made me to put that.


I checked my path and found this:

E:\oracle\product\10.2.0\db_1\bin;c:\oracle\ora92\bin;
C:\Program Files\Oracle\jre\1.3.1\bin;
C:\Program Files\Oracle\jre\1.1.8\bin;
e:\oracle\ora92\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
C:\Program Files\K-Lite Codec Pack\QuickTime\QTSystem\;
C:\Program Files\Java\jdk1.6.0_04\bin (This is the current version I have been using since a month)

Now in 2nd and 3rd line, there are another two path mentioned(besides my actual path which should be one in Line 6) which i have quoted in bold. Do I need to remove both 2nd and 3rd line path's ??
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12015
24
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whenever you type a command like "javac myFile.java", the OS uses the PATH variable to know where to look for the executable. It looks in the order the directories are listed in your path. So, if the jre you want to run is line 6, you can either remove the other two or just re-arrange them so the proper one comes first in the list.
 
Shivit Agarwal
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After deleting the line 2 and 3 it is now showing the old error which i got at the startup --
NoClassDefFoundError

So i brought line 6 at the first but still the above error "NoClassDefFoundError"

What should I do now ??
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shivit Agarwal:
After deleting the line 2 and 3 it is now showing the old error which i got at the startup --
NoClassDefFoundError

So i brought line 6 at the first but still the above error "NoClassDefFoundError"

What should I do now ??
Try javac -version, which should give something like 1.6.0_05.

Of course, NoClassDefFoundError is a new error; you need to go through your folder to find where the class you are looking for has gone . . .
 
Shivit Agarwal
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hurray !!! The problem is solved now. I have reinstall jdk and simply set the path.


Thank You everyone anyway . Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic