aspose file tools*
The moose likes Beginning Java and the fly likes Wierd Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Wierd Error" Watch "Wierd Error" New topic
Author

Wierd Error

Shivit Agarwal
Ranch Hand

Joined: Feb 28, 2008
Posts: 82
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 ]

Have the determination of mirror which never fails to reflect in spite of being broken into pieces.<br /> <br />Kiss the hands you cannot bite.<br /> <br />An Optimist is one who starts taking a bath when he accidentally falls into the water.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38902
    
  23
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

Joined: Aug 31, 2004
Posts: 11343

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.)


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Shivit Agarwal
Ranch Hand

Joined: Feb 28, 2008
Posts: 82
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

Joined: Oct 02, 2003
Posts: 11322
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Shivit Agarwal
Ranch Hand

Joined: Feb 28, 2008
Posts: 82
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

Joined: Oct 13, 2005
Posts: 38902
    
  23
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

Joined: Feb 28, 2008
Posts: 82
Hurray !!! The problem is solved now. I have reinstall jdk and simply set the path.


Thank You everyone anyway . Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wierd Error