Java version is different on GUI and command line

Discussion in 'macOS' started by droopy4u, Jul 18, 2015.

  1. droopy4u, Jul 18, 2015
    Last edited: Jul 18, 2015

    droopy4u macrumors newbie

    Joined:
    Jul 18, 2015
    Location:
    Belgium
    #1
    On my Mac I have two different indication of the JAVA version

    $ uname -a
    Darwin Mr-MBP.lan 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015;
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64


    Via the command line

    $ java -version
    java version "1.7.0_45"
    Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)


    unfortunately via the GUI

    [​IMG]


    GUI java indication is 1.8

    So I tried to do it via command, but then it doesn't recognise


    $ ls /Library/Java/JavaVirtualMachines/
    jdk1.7.0_45.jdk
    $/usr/libexec/java_home -v 1.8.0_45 --exec javac -version
    Unable to find any JVMs matching version "1.8.0_45".
    javac 1.7.0_45



    A reboot didn't solve the problem.

    Anybody some suggestions?

    Thanks.
     
  2. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #2
    There are two parts to Java.

    There is the JRE (you are on 1.7) that OS X uses to run Java apps on your Mac.

    Then there is the Java web plugin (you are on 1.8) that is used to run Java on web pages.

    If you want to update both you need to install the full JDK.

    That said, there is really nothing wrong with what you have going on there now. You want the latest plugin for security issues, but with the JRE to run local apps, some people keep the older version because their apps may not run on the newer one.
     
  3. droopy4u thread starter macrumors newbie

    Joined:
    Jul 18, 2015
    Location:
    Belgium
    #3
    @Weaselboy Thanks for your quick answer, I gonna try to install the full JDK, so both versions are the same and up-to-date.
     
  4. droopy4u thread starter macrumors newbie

    Joined:
    Jul 18, 2015
    Location:
    Belgium
    #4

    @Weaselboy, I have a stupid question ... how does it come that I still have two different versions?
    https://www.java.com/en/download/faq/java_mac.xml
    I followed the note and installed the 8u51 jdk

    After reading this, I'm little bit confused, because I didn't install another version (before the update of the jdk now), or a plugin for the web ...

    http://www.javatpoint.com/difference-between-jdk-jre-and-jvm
     
  5. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #5
    What are you showing installed now? You may have both JRE 7 and 8 installed at once so apps can use either.
     
  6. droopy4u thread starter macrumors newbie

    Joined:
    Jul 18, 2015
    Location:
    Belgium
    #6
    command line :


    java -version
    java version "1.8.0_51"
    Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)


    GUI indication :

    gives still the same indication of version 1.8.0_45

     
  7. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California

Share This Page