Re: Jdk 1.6 will not compile: cannot access java.lang.Object



rzeira@xxxxxxxxxxx said:
I just installed Jdk 1.6 update 4 and tried my first compilation. I
compiled something that previously compiled easily. However, with Jdk
1.6 I got the error:
SomeFile.java:45: cannot access java.lang.Object
bad class file: C:\Tools\Jdk16\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.
private UserRec currRec = null;

I compile directly with javac from a DOS prompt. I tried to compile
few other files and got the same results.

Looks much like the "javac" executable you're running is from some
older JDK version. Check each directory on your %PATH% to find out
which javac you're actually running.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.



Relevant Pages