Notes on Java

How to disable the classloader cache on OS X

After considerable difficulty, I found out how to turn off the "classloader cache", that lovely feature that requires developers to type "x" to "clear classloader cache" every time they want to test a revision of a applet they are developing.

It can be turned off by setting the system property javaplugin.classloader.cache.enabled to false. (Learned from this page)

How do you set system properties, you may ask? You can set them with the -D runtime option. (Learned from the java man page)

But, I'm not running the command-line java, it's being run automatically from the browser, you say. Well, in that case you need to set it in the Java 1.4.2 Plugin Settings.app (the "Java Runtime Parameters" textbox on the "General" tab), and restart the browser. The Java 1.4.2 Plugin Settings.app is located in /Applications/Utilities/Java/. (Learned about the existance of the Plugin Settings.app here)

So, to put it all together, to disable the classloader cache, you put "-Djavaplugin.classloader.cache.enabled=false" into the "Java Runtime Parameters" textbox in the "/Applications/Utilities/Java/Java 1.4.2 Plugin Settings.app", and restart the browser.

Hope this helps! -- Mon Apr 14 00:44:11 2008


Return to homepage