Recently installed Java 7 on Mac OS X

By | 2011-08-20

I recently installed Java 7 on my Mac OS X system. Although the installation went smoothly, I did run into one problem that might not be a big issue for you.

I didn’t go through the hassle of compiling it for myself. Instead, I opted to grab a precompiled JDK from here: http://code.google.com/p/openjdk-osx-build/downloads/list?q=label:Featured

Specifically, I chose the OpenJDK 1.7 universal (32/64 bits) from Mac OS X branch download. Then I ran the /Applications/Utilities/Java Preferences.app to 1) pull both 1.7 versions to the top of the list, and 2) select those 1.7 versions, and 3) unselect the 1.6 JDK I also have installed.

NetBeans seems to run just fine. I’m able to create a new target JDK for the IDE, etc.

Now the problem: I tried running jrunscript from the command line to do some simple tests of new functionality in Java 7. I have found the simple jrunscript JavaScript interpreter to be an excellent way to quickly access Java classes for simple tests, confirmation of APIs, etc. Oddly, the tool didn’t run correctly despite being available in the JDK’s bin directory. Here’s the output of my attempt:

$ which java
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java
$ which jrunscript
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/jrunscript
$ jrunscript
script engine for language js can not be found

Anyone ever see this before? Find a solution? Thanks in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *