title: Cannot compile Java code - "class file has wrong version 52.0, should be 48.0"
body: <p>I know that this appears everywhere with a bunch of threads but I followed the instructions and it did not work! 
  I get the following error:</p>
  
  <blockquote>
    <p>cannot access java.lang.Object
    bad class file: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/rt.jar(java/lang/Object.class)
    class file has wrong version 52.0, should be 48.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
        public static void main (String [] args){
                                     ^
    1 error</p>
  </blockquote>
  
  <p>I downloaded the latest runtime, and the latest JDK. If I do /java version in Terminal (I'm using Mac), I get:</p>
  
  <blockquote>
    <p>java version "1.8.0_60"
    Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
    Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)XXXXX-MacBook-Pro:~ XXXXX$ </p>
  </blockquote>
  
  <p>What should I do now? I set the JAVA_HOME and it still doesn't work. Thanks for your help.</p>