JDK-4233380 : URLClassLoader does not delete cached jar files
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.2.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1999-04-27
  • Updated: 1999-04-27
  • Resolved: 1999-04-27
Related Reports
Duplicate :  
Description

Name: vi73552			Date: 04/27/99


Bug ID 4180369 says URLClassLoader cached jar files (jar_cacheXXX.tmp) should be deleted on exit as of 1.2fcs(File.deleteOnExit).

This isn't happening.  Run the attached application and check your temp directory - it leaves the jar_cache file after exiting.  Use "jar tvf" to view the contents of the jar_cache file to verify it is the one specified in the URL in the source code.


import java.net.*;
public class JarCacheJunk {
	public static void main(String args[]) throws Exception {
		URL urls[] = new URL[1];
		urls[0] = new URL("http://morechat.talkcity.com/java/ezclasses/ezlite.jar");
		URLClassLoader cl = new URLClassLoader(urls);
		Class cls = cl.loadClass("lw.ezlite.EZLite");
		System.exit(0);
	}
}
(Review ID: 57157) 
======================================================================