Supporting Java Applets in macOS Catalina

In the wake of a sudden pivot to remote instruction we’ve had to look at different ways to support applications used in classes. One specific example is an application that is provided by the US Geological Survey called TopoDrive and ParticleFlow. Available on the website is an executable for Windows machines. We have that loaded to a Windows lab on campus. Unfortunately, many students only have a macOS device to use at home and could not easily run the programs, especially as modern web browsers have deprecated java plugins making it difficult to run the applet version.

So to support these students I ran some testing. I was able to get the applet version to run if I installed a version of OpenJDK 8. I chose Amazon’s Corretto distribution. After installing I was able to run the application using the appletviewer command. Turns out that was pretty simple to get working, once the JDK is installed.

appletviewer ~/Downloads/tdpf1.0web/pflow/pflow.html

Running that line executes the html file with the java applet assuming it was in the default location of the user’s /Downloads folder. To take that one step further I can save it as a bash script to easily execute again. I could use the .command extension and it will run the script using the java JDK appletviewer command. But to make it one step simpler for students to use on personal machines, I used Platypus and created an app out of the one line script.

Platypus is a simple application that can build a few different types of apps out of basic scripts. I simply took my saved script, added a custom icon and built the .app file. by Svein Bjorn

I duplicated this for both applets in the download, TopoDrive and ParticleFlow. Once you click the desktop icon you get the following window:

html page that includes the launch button

And after clicking the button the Applet launches:

the applet launches in its own window

If I was deploying this to managed machines in my own organization I would have signed the app and deployed it to /Applications, installed the correct version of Amazon Corretto and stored the files in a shared location, such as in the /Users/Shared folder. But as I am offering this to students with unknown versions of macOS, and without a management framework to use the easiest way was to email instructions and a .zip file with the .apps. The steps were:

While it is very simple I have the scripts and Platypus created applications on GitHub here.