Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

rt.jar Wrong version?

843804May 24 2005 — edited Aug 3 2005
Greetings, I have this Internal Frame SWING UI that works on my other computer perfectly, I copied the .java to this one that has the latest JDK 1.5.0_03, but whenever I try to compile it, this error comes up

"Eliminar.java": C:\Documents and Settings\progweb\jbproject\apoyo\Eliminar.java:7: cannot access javax.swing.JInternalFrame,bad class file: C:\Program Files\Java\jdk1.5.0_03\jre\lib\rt.jar(javax/swing/JInternalFrame.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 classpath. at line 7


I browsed through rt.jar and JInternalFrame IS inside.

I get issues with ANY SWING Component, JInternalFrame, JDIalog, etc it says the same rt.jar wrong version.

Comments

843804
Both JAVA_HOME And path point to the right directories.
843804
Bah keep forgetting to add this info,

java -version reports 1.5.03
800382
for compilation? that's weird. I can see maybe running the class, unless that's not the error I'm thinking of.

Did you define a serialversionID (is that it?) field? Maybe that needs to be updated.
843804
Hi ,

first u check out the version
try java -version
because sometimes the paths are set corectly but the lower version of the java path is before of the ur jdk1.5 path.
843804
We have also just now encountered this same peculiar error message since we just upgraded our JDK from 1.4 to 1.5 (in our case on a Solaris platform). Java code that had previously compiled without error now produces this message:


"cannot access javax.swing.JInternalFrame,bad class file: /usr/jdk/jdk1.5.0_04/jre/lib/rt.jar/javax/swing/JInternalFrame.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 classpath. at line 12, column 20"


We likewise verified with unzip that that particular class file it complains about does in fact exist in rt.jar. The Java compiler just doesn't like something about it. Are we looking at a bug in version 1.5 of the JDK?
# pwd
/usr/jdk/instances/jdk1.5.0/jre/lib
# ls -l rt.jar
-rw-r--r--   1 root     bin      39728596 Jun  3 07:31 rt.jar
#  unzip -l  rt.jar javax/swing/JInternalFrame.class
Archive:  rt.jar
PACK200
 Length    Date    Time    Name
 ------    ----    ----    ----
  16349  06-03-05  05:37   javax/swing/JInternalFrame.class
 ------                    -------
  16349                    1 file
# java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Server VM (build 1.5.0_04-b05, mixed mode)
#
jwenting
there we go again, question's been asked and answered hundreds of times already all over the forums.

Get rid of java.exe and javaw.exe from your windows directory tree.

But then you could have found that answer easily yourself, so I wonder why I regurgitate it again and again and again.
843804
This is occurring on Solaris, not Windows. There is no java.exe or javaw.exe to get rid of. (But then if you had actually read my posting you would have known that).
843804
try this
javac -target 1.5 myApp.java
for classfile version 49.0
jwenting
This is occurring on Solaris, not Windows. There is
that's weird:
""Eliminar.java": C:\Documents and Settings\progweb\jbproject\apoyo\Eliminar.java:7: cannot access javax.swing.JInternalFrame,bad class file: C:\Program Files\Java\jdk1.5.0_03\jre\lib\rt.jar(javax/swing/JInternalFrame.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 classpath. at line 7"

looks suspiciously like Windows paths to me :)
843804
I should have mentioned earlier that we are using Borland's JBuilder X (Foundation) to compile. And yes, after fine-tuning my Google-searching I see now that this "version 49/version 48" mismatch business is really a wide-spread problem among those upgrading to JDK 1.5; i.e., is not peculiar to just this one "JInternalFrame.class" file. I'm told the solution in our case is to upgrade to JBuilder 2005. But unfortunately for us, JBuilder 2005 requires Solaris 9 while our project is pretty much locked into Solaris 8. (head scratch ... ).
843804
in my case it was using the old tool.jar file, removing it from the classpath fixed it
843804
i have problem with this rt.jar
i have sql server connection in my jsp page whenever i login through that page i have an error message that

rt.jar has wrong version 49.0 should be 48.0

please reply me how to solve this problem
jwenting
sigh...

Another thread hijacker. POST YOUR OWN THREADS but of course not before doing a bit of homework which would lead you to the cause of your problem very easily.
jwenting
in my case it was using the old tool.jar file,
removing it from the classpath fixed it
why did you have tools.jar on the classpath anyway?
It's automatic.
1 - 14
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 31 2005
Added on May 24 2005
14 comments
249 views