Java issue

Discussion in 'Mac Basics and Help' started by forumr, Jul 30, 2014.

  1. forumr, Jul 30, 2014
    Last edited: Jul 30, 2014

    forumr macrumors newbie

    Joined:
    Jul 30, 2014
    #1
    Hey! Lately, I've had an issue where some applications won't boot and I get the error that Java runtime is not installed. It requests an install and then gives me an error because it can not grab a fresh install for me.

    I've attached a screenshot with the contradictory Java problem. Can someone explain to me what is going on?
    [​IMG]
     
  2. Tonsko, Jul 31, 2014
    Last edited: Aug 1, 2014

    Tonsko macrumors 6502

    Tonsko

    Joined:
    Aug 19, 2010
    #2
    Ok, you might have some fun with this!

    So I realised myself recently that I hadn't updated JavaSE since it was 1.6. Updating it to 1.8 was a pig. If you are trying to install the 'full' java and not simply JavaSE, then this may not help :(

    So, to start
    Code:
    $whereis java
    should produce:
    Code:
    /usr/bin/java
    That will be a link so to find out where it's pointing:
    Code:
    ls -al /usr/bin/java
    and post the result.
     
  3. forumr thread starter macrumors newbie

    Joined:
    Jul 30, 2014
    #3
    [​IMG]

    So it didn't even produce the result we thought it would.
     
  4. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    You need to install the JDK from here. That will update both the runtime and the web plugin.

    That web site check is just telling you you have the web plug in and has nothing to do with the runtime.
     
  5. Tonsko, Aug 1, 2014
    Last edited: Aug 1, 2014

    Tonsko macrumors 6502

    Tonsko

    Joined:
    Aug 19, 2010
    #5
    Ok, I think I see what's happened here. I reckon you're running Java 1.6. Later versions of JavaSE (i.e. current is 1.8) live in a different place. So whilst you have to d/l the latest version (provided by Weaselboy above) you will have to manually point OSX at the new Java version.

    To make certain, run the command: [Tip: You don't need to type the whole word in each directory, once you have typed three or four letters, <tab>will autocomplete the directory name. If it doesn't do this, press <tab> again and you will get a shortlist of directories with the same few letters. Simply type a few more letters to zero in on it.]

    Code:
    /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java -version
    and post the result.

    This is mine:
    Code:
    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-462, mixed mode)
    If that is the case, and you have downloaded JSE 1.8 & installed it and you're still getting the error then:

    N.B. If you're at this point and it's not exactly like this, I'd hesitate to run the following as it might screw things up more :)

    Code:
    sudo mv /usr/bin/java /usr/bin/java-1.6
    This moves your existing link file to java-1.6 (rather than deleting it, it means you can roll back if anything goes wrong)

    Install the newly downloaded version; Then:

    Code:
    sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java
    That sets up the new link to the new install directory for java. [How did I find this directory? I used the command 'whereis java'. If that doesn't work, you could try 'sudo find / -name java']. Then you should be able to run:

    Code:
    java -version
    and get a result like:

    Code:
    java version "1.8.0_11"
    Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
    If you don't, try a reboot.

    FYI, I was dicking around with this for ages. I'm pretty confident with the command line, but not sure if you are; it's not straightforward. As I said, if you're getting different results at any point, it may not work for you. Good luck!
     

Share This Page