Reputation: 51
I would like to remove a specific cached jar file from a Java program. Java cache behaves weirdly sometimes, and keeps loading an old jar even if a new one should be used.
The "Java Control Panel" has a "Java Cache Viewer" feature that allows us to see cached jar files.
I was wondering if there was a way to detect a cached jar file but directly from a java program, and then remove that file. Is there an API allowing that?
Upvotes: 2
Views: 4750
Reputation: 47
Yes! I've just found a solution to this problem. There's a command line statement "javaws" that let's you handle specific java-related actions. You can type javaws into your console/terminal and it'll give you options but to remove a specific application, you could add this to your code:
Runtime.getRuntime().exec("javaws -uninstall <jnlp file>");
where can be the file or a url.
Hope this helps!
Upvotes: 2
Reputation: 15690
See http://download.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/applet_caching.html for ways to control the cache.
Upvotes: 0