MacOS – How to properly install Java in OS X

javamacos

  • When I look at System Preferences > Java > Update, I see

    Your system has the recommended version of Java.
    Java 7 Update 79

  • From Terminal, java -version:

    java version "1.7.0_71"
    Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

  • From Terminal, export:

    JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home"

  • In addition to that, I also have the Java from Apple/Oracle installed as well (when first prompted to install when opening a Java-based app when there's no Java yet installed)

Questions:

  1. Is Java 7 Update 79 == jdk1.7.0._71.jdk? Or are these separate?
  2. When running some thing with Java, there is always the following:

    objc[63077]: Class JavaLaunchHelper is implemented in both
    /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java
    and
    /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/libinstrument.dylib.
    One of the two will be used. Which one is undefined.

I'd be more than willing starting from scratch had I understood the steps to do that properly (remove, re-install). If it matters, am running OS X 10.10.

Best Answer

System Preferences shows the Java used for web applets and java -version the one found by /usr/bin/java

To get the latter install the JDK not the JRE