JTree error after installing jdk 5
Hello:
I have just installed jdk 5. On the very first trial compilation of my application I received the following error:
"S3i2BusinessDB.java": cannot access javax.swing.JTree,bad class file: C:\JBuilder9\Java\jdk1.5.0_01\jre\lib\rt.jar\javax\swing\JTree.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 5, column 20
What does that mean and what I should do to correct the problem?
Obviously I have not changed anything after running the downloaded file.
Thank you,
Alex Bogomolny
[623 byte] By [
AlexBoa] at [2007-10-1 7:20:04]

JTree.class, as part of Java 5, has been compiled using the Java 5 compiler, which labeled the file with a version number of 49.0. Then you tried to execute the file using a class that was compiled with a prior version of Java (I believe 48.0 is 1.4.2_07) which cannot handle the new code of Java 5.
If you want to use Java 5, one way is to recompile everything using it. Another way is to not use the new Java 5 capabilities in your code, and compile the class files so they're compatible with older Java versions. To compile this way, refer to the javac command documentation for further information about the use of the -source and -target options, especially the -source 1.4 option
Otherwise make sure tha the apps compiled with older versions use the older matching version of rt.jar.
Thank you for the clarification.
I work with JBuilder9 with the facility to use multiple jdk. Every time I switch, I have to recompile all my code, which I of course did also after installing jdk 1.5. I certainly have not yet used any specifics of jdk 1.5 as this was my very first attempt of recompiling with the latest jdk. So it's all a mystery.
Perhaps reinstalling 1.5 will help.
Thank you again,
Alex