Getting Java client apps to run the way you want

Sep 16, '14 07:00:00AM

Contributed by: pglock

I sometimes find the Java setup on my various Apple devices to be a mystery.

Recently, I was trying to get a Java applet to run in the same way on 2 iMacs and my MacBook Air. The applet is a simple vpn client from Juniper that lets me access a Citrix Desktop from any Mac that I can install the Citrix receiver client on so I can work on 'Company stuff' from a large screen iMac when I'm sat at home or from my MacBook when I'm on the road (it works fine over 3/4G).

The first thing is that you have to do some configuring of both Java and Safari to get the applet to run at all.

Once that was all done, I could log in from all my Macs, fire up the applet and establish a secure connection.

On two of the Macs, as soon as I fired up the Citrix app, the Java vpn window would show 'error'. The console showed a Java crash. But on the third Mac, everything worked fine. I made sure that the Safari and Java preferences were set the same on each machine but still no joy. Then I remembered that I had done some Java development in the past and installed various jdks from Oracle so I ran:

java -version 

in Terminal on each machine. I keep everything up to date via the Java control panel (currently 1.7xx soon to be 1.8) so was surprised to see this:
java version "1.6.0_65" 

That was on the working Mac. Then I remembered the difference between 'System' Java, Java plugins, and Java development kits. Simply put, you can have multiple versions of Java in different places. What was happening on the not-working Macs was that the jdk versions were being used, and the Juniper vpn client won't work with them.

To fix things for the moment I simply removed the jdk folders.
sudo rm -fr /Library/Java/JavaVirtualMachines/* 

And then checked that the reported version of Java was 1.6 on each Mac. Web applets still use the up to date, secure version 1.7 plugin.

[crarko adds: I believe Oracle has said that eventually Java will no longer support applets at all, on any platform.]

Comments (8)

Mac OS X Hints