This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
compile: [javac] Compiling 1 source file to C:\AntBuild\ant\reddy [javac] [parsing started C:\AntBuild\ant\reddy\Helloo.java] [javac] [parsing completed 140ms] [javac] [loading C:\Program Files\Java\jre1.5.0\lib\rt.jar(java/lang/Object. class)] [javac] C:\AntBuild\ant\reddy\Helloo.java:3: cannot access java.lang.Object [javac] bad class file: C:\Program Files\Java\jre1.5.0\lib\rt.jar(java/lang/ Object.class) [javac] class file has wrong version 49.0, should be 48.0 [javac] Please remove or make sure it appears in the correct subdirectory of the classpath. [javac] public static void main(String ll) [javac] ^ [javac] [total 5367ms] [javac] 1 error
You're asking a JDK 1.4 compiler to compile against the JDK 1.5 runtime classes, and it's refusing to do so. Check your CLASSPATH environment variable (which shouldn't include any copy of rt.jar) and check your build.properties file, if you have one.