4

If you're using Java < 1.7 on OS X and you need to use JSObject for connecting an applet to JavaScript, you can find it in in $JAVA_HOME/jre/lib/plugin.jar.

The "plugin.jar" archive doesn't seem to exist on Java 1.7 for OS X (as packaged by Oracle). There is a jfxrt.jar that seems to contain JSObject, but that unfortunately means that you can't use the same plugin.jar that you can on almost any other JDK, including 7u5 for Linux, which still has plugin.jar built right in.

In particular, this gets irritating if you're trying to use it as a compilation dependency for a build tool such as Maven, which you could otherwise do with a JAVA_HOME-relative path.

Geoffrey Wiseman
  • 5,459
  • 3
  • 34
  • 52
  • I could easily put the jfxrt.jar in my local repo with a generic name and put the plugin.jar on other platforms into the local repo on those systems, but that's pretty awkward, particularly if plugin.jar is likely to reappear in a later JDK patch release. – Geoffrey Wiseman Jul 02 '12 at 17:35

2 Answers2

2

Java 7 on Mac OS X doesn't support the Java plugin. So, plugin.jar is simply not there. If you manage to find the Java 7 installation guide for Mac OS X on Oracle's website (good luck with that) you'll see:

Note that for the 7u4 release, Java plugin and Java Web start applications are not supported.

And, yes, 7u5 is out, but its release notes say it's just a bug and security fix. I'm assuming Oracle just didn't bother to update their installation notes. It looks like the 7u6 developer preview does include the plugin, so at least it's on its way.

The jfxrt.jar file is for Java FX, which is included in the Oracle Java 7 Mac OS X release. Of course, Java FX is built on top of Java applets and is intended to run via the Java plugin, so don't ask me why it would be included in Oracle's Mac OS X Java 7 release while the Java plugin itself isn't. (I guess you can build Java FX apps, you just can't run them?)

The real answer appears to be "don't use Java 7 on Mac OS X quite yet." Which may be one of the reasons Oracle extended the Java 6 EOL until November.

  • Ah, that's very interesting -- I didn't even consider that possibility. The Java Plugin is still working for me, but that's not exactly shocking given that I still have Java SE 6 installed as well. – Geoffrey Wiseman Jul 27 '12 at 02:54
  • This adds slightly to the confusion by implying it'll be in the JRE but not the JDK in u6: http://jdk7.java.net/macportpreview/releasenote.html – Geoffrey Wiseman Jul 27 '12 at 03:03
2

Plugin.jar is available on Java 7u6 for OS X, now available.

Geoffrey Wiseman
  • 5,459
  • 3
  • 34
  • 52