5

In brief

The JRE is installed but javaws can not find the JRE.

What can I do on the command line to re-enable the web plugin for Apple's Java 6 in Chrome or Safari?

I want to avoid Java 7. (We're awaiting Java 8.)

Detail

I have a fresh upgrade of Mountain Lion (10.8.2). I have installed JDK V6 from Apple (Java for OS X 2012-006). Now:

  • all of my Java apps run fine
  • the Internet plug-in no longer works in Chrome or Safari.

javaws at the command line reports:

No JRE present

When a web applet is clicked:

  • the operating system directs me to install a JRE
  • the link goes nowhere because the JRE is already installed.

 History

  1. Upgraded to Mountain Lion
  2. Forced JRE install through java -version method. "Successful"
  3. All Java applications work as before (ide/dbms/email/etc)
  4. Tried to launch a java applet in Chrome (or Safari)
  5. Message in the applet area "Missing Plugin =>". click it
  6. Error that the 'JRE is not installed, click ok to open page...'.
  7. Click [OK] but no page opens. Assume this is because the JRE is actually already installed.
  8. Try from command line (/usr/bin/javaws):

When I try /usr/bin/javaws from the command line I get this output, plus the standard install-a-jre popup.

[~] /usr/bin/javaws  (or just [~] javaws)
No Java runtime present, requesting install.
Unable to locate a Java Runtime to invoke.

– but the JRE is present –

[~] /usr/bin/java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

– Java apps do run.

Java executables

[~] ll -s /usr/bin/java*
/usr/bin/java@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
/usr/bin/javac@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
/usr/bin/javadoc@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javadoc
/usr/bin/javah@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javah
/usr/bin/javap@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javap
/usr/bin/javaws@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javaws

I heard that it may be possible to install the Java 7 JDK (including a JRE) to regain preferences and enable switching. If that is the only course of action I will do it, but I would much prefer JAVA_HOME to work properly with Java 6 without Java 7.

Apple's Java Preferences utility is no longer applicable – Apple's most recent update for Java for OS X removes the utility.

Andrew
  • 252

3 Answers3

4

At About Java for OS X 2012-006 (article HT5493, modified 2012-10-16) Apple gives a related article:

Please run all four commands. The fourth should re-enable Java SE 6 Web Start.

Graham Perrin
  • 7,739
  • 14
  • 81
  • 245
0

I solved my problem with javaws with this:

  1. I went into the /usr/bin directory:

    cd /usr/bin/
    
  2. Just in case made a backup copy of the existing javaws:

    sudo mv javaws ./javaws.ORIGINAL
    
  3. Create a new link to a javaws file that I found when searching my file system (probably create on a previous installation of Java):

    sudo ln -s /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/javaws ./javaws
    

Et voilà! javaws start working again!

grg
  • 201,078
-1

Have you checked "Enable applet plug-in and Web Start Applications" in "Java Preferences" ??

http://support.zipform.com/zf6/KBA-01629.asp

Rene Larsen
  • 6,495
  • 1
    This is removed in ML (10.8), hence the problem and tag and title. – Andrew Nov 26 '12 at 02:09
  • Well - it is only removed i ML if you have upgraded to JRE/JDK 7, and as I read the problem described, then it is still JRE/JDK 6 that is been used. – Rene Larsen Nov 26 '12 at 07:11
  • It is removed when upgrading to 10.8.2 as I did. I am fairly sure other versions of 10.8 are also affected. I have never installed JDK/JRE 7. This was apparent the moment the upgrade was complete. Lost me access to citrix until I can get them to allow reciever access. http://apple.stackexchange.com/questions/68743/mountain-lion-10-8-2-java-preferences-has-disappeared , and google - https://www.google.com/search?q=mountain+lion+removes+java+preferences – Andrew Nov 26 '12 at 07:44
  • 1
    No, the OS X 10.8.2 update didn't remove the Java 6 setup on your system - but the Java update 2012-006 where you got the JRE/JDK 6 update 37 did that - http://support.apple.com/kb/HT5493 – Rene Larsen Nov 26 '12 at 14:12
  • You are right. I don't know what I was thinking, i'm sorry about that. It must have been something I ate. Even my question mentions the update as doing it, not ML. I think I just installed them back-to-back basically. If you edit the question (however briefly) I'll fix my foolish vote. – Andrew Nov 28 '12 at 03:36