How to Install Java in OS X Mavericks

Nov 1, 2013 - 14 Comments

Install Java in OS X Mavericks Java has plenty of real-world applications and uses, but because it has been used as an attack vector in the past, Apple has made OS X reasonably aggressive in limiting Java on Macs. As a result, Mavericks does not come with Java preinstalled, and upgraded Macs will remove Java in Mavericks installation process. For most users this is a very good thing, it further reduces the unlikely event of a trojan or something nefarious being installed on Macs, and many Mac users won’t notice Java missing at all. On the other hand, many of us do need Java installed in OS X.

Many common applications use Java, ranging from the excellent cloud backup service CrashPlan, to the Eclipse IDE, and even some online banking and financial services, and without installing Java yourself in Mavericks you’ll find these apps and websites simply don’t work. Fortunately it’s a simple fix just like in 10.8, and you can go about installing Java on OS X Mavericks in several different ways.

Install Java in Mavericks through the Command Line

Installing Java through the command line is perhaps the easiest. All you need to do is launch Terminal, found in /Applications/Utilities/, and enter the following command:

java -version

Assuming Java is not on the Mac already, this command will trigger a popup that says something along the lines of “To open Java, you need a Java SE runtime. Would you like to install one now?” – click “Install” when asked to begin the simple process.

Installing Java in Mavericks

From here on it’s just like installing any other package. Remember, you will probably need to relaunch certain apps that are Java dependent to get them working again, including web browsers if it’s a website you are attempting to access that requires a Java applet to run.

If you run that command and already have Java installed, you’ll simply see the currently installed Java version instead, like so:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-465, mixed mode)

If you’re not a fan of the command line, or would rather get the latest version of Java installed in OS X 10.9 directly from Oracle, that’s what we’ll cover next.

Option 2: Installing the Latest Java Version from Oracle

The other option to get the latest version of Java is to simply download it from Oracle and install manually.

Most casual Mac users only need to get the JRE (Java Runtime Environment) and not the full JDK (Java Development Kit).

Downloading directly from Oracles website insures the latest version will be installed, and it also has the advantage of allowing for remote installation and upgrades on Macs through Remote Login or SSH.

OS X handles Java well these days, and and newer versions of Safari even let you allow the Java plugin on a per website basis, further limiting it’s potential problems.

Remember, for most Mavericks users, you can avoid Java and not worry about it. Installing Java is really only necessary if a crucial application or web service requires it.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks

14 Comments

» Comments RSS Feed

  1. alex says:

    when I type “java version” in terminal i get the following message:
    Exception in thread “main” java.lang.NoClassDefFoundError: version
    Caused by: java.lang.ClassNotFoundException: version
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

  2. Darren says:

    trying to install java 7 u45 here on mavericks and keep getting the installation failed, installer encountered an error etc…

  3. TheDan says:

    I updated JRE to version 7 build 45. The OS X Terminal app confirms this (> java -version). After leaving Terminal and reopening Terminal, I’m back to 1.6.0.65. The update is to there anymore?

  4. John says:

    Mavericks is refusing to use Java 7 Update 45 from Oracle. I enabled show console in Java Control Panel and the console does’t start when starting a java app. In ML used to start right away.

  5. Peter says:

    For those wondering about java -version behavior after you’ve installed Java – you’ve probably installed just the JRE:

    http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jre.html
    Installing a JRE from Oracle will not update java -version symlinks or add java to your path. To be able to do this, you need to install the JDK.

  6. angrest says:

    strange – when I enter “java -version”, I will be directed to Oracles java site.

  7. Anthony says:

    When I do “java version”, all I get is the error message “java.lang.NoClassDefFoundError” and I have installed the latest version from Oracle.

  8. Luis says:

    Is it better to install Java SE 6 or Oracle’s Java?

  9. Stephen says:

    This is odd. I have upgraded to OS X Mavericks. I have Java 7 installed from the Oracle site. It works fine. If I go to Terminal and enter “java -version”, I get the message “No Java runtime present, requesting install”. No popup appears as shown in the article. I have the JavaAppletPlugin.plugin within the /Library/Internet Plug-ins folder, but there is nothing anywhere else, no Java folders of any kind.

  10. RB says:

    @henric is right, if you want the latest version in Mavericks download the newest JRE, install it, then run this command:

    export JAVA_HOME=”/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home”

    You can double-check afterwards by doing java -version again, you’ll be on 1.7x

  11. Henric says:

    Even if you install the package from Oracle, when a Java app is launched it prompts to install 1.6.0_65 from Apple.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site