Wednesday, May 9, 2012

Java Applet - Clear Java cache

Recently I started to write Java Applet by following the tutorial on Oracle website (http://docs.oracle.com/javase/tutorial/deployment/applet/index.html). One of the features I will need is to invoke Applet methods from JavaScript. The sample code in this subject, Invoking JavaScript Code From an Applet, works fine. But I just could not get my code work after I changed everything (parameter values, function name, and etc...) accordingly in the sample code. The weird thing was it kept using the Applet from the sample code, and never used the one I just created. After doing hours of research on the Internet, I found that Java also has the cache mechanism to improve performance just like the web browser. So after I cleared the Java cache, everything worked as expected. Here is the how-to of clearing Java cache.

Go to Control Panel

You may need to switch to Classic View if you are in Category View

Double click on Java icon and you will see Java Control Panel pops up, then click on Settings...

Click Delete Files...

I deleted all of them


Note, the sample code I downloaded for Invoking Applet Methods From JavaScript Code tutorial is missing the file applet_InvokingAppletMethodsFromJavaScript.jar (as of now). To obtain the jar, go to http://docs.oracle.com/javase/tutorial/deployment/applet/examples/dist/applet_InvokingAppletMethodsFromJavaScript/applet_InvokingAppletMethodsFromJavaScript.jar if you don't feel like compiling the source files for now.

No comments:

Post a Comment