Error while compiling java file using J2SE 1.5.0
Dear Sir,
I'm getting the following error while compiling the java file.The code is also given.
package test;
public class TestRowSet {
public TestRowSet() {
}
}
"TestRowSet.java": cannot access java.lang.Object,bad class file: D:\Program Files\Java\jdk1.5.0\jre\lib\rt.jar\java\lang\Object.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 4, column 1
Please help me out.
--Suketu Naik.
Thanks for your suggestion.
But I'm compiling within "Borland JBuilder 9.0". I've set the JDK path of the current project to point to the path of JDK 1.5.0 . I've also tried to compile at command prompt with "javac". I'm getting the same error of "Undefinedclassloader" with long StatckTrace.
The prior answer is correct, somehow you are mixing two different versions of Java.Try compiling from the command line, it should work. I don't use that IDE, sorry, can't help fix it.
> But I'm compiling within "Borland JBuilder 9.0". I've
> set the JDK path of the current project to point to
> the path of JDK 1.5.0 . I've also tried to compile at
> command prompt with "javac". I'm getting the same
> error of "Undefinedclassloader" with long StatckTrace.
>
I don't know anything about JBuilder either. If you use the command prompt and enter the full path to the 1.5 javac.exe then that will prove whether the issue is using an older javac or not. For example "c:\j2sdk1.5.0_01\bin\javac HelloWorld.java"