Hello, I have the following problem:
During the uninstall process, I load the JAR (jdbc-driver).
URL pDriverJar = jarToDelete.toURI().toURL();
URL[] lURLList = new URL[]{pDriverJar};
URLClassLoader lLoader = new URLClassLoader(lURLList, Thread.currentThread().getContextClassLoader());
Thread.currentThread().setContextClassLoader(lLoader);
Class<?> aClass = Class.forName("jdbc.Driver");
if(jarToDelete.delete()){
System.out.println("deleted");
}else {
jarToDelete.deleteOnExit();
}
After the completion of the JVM, the bank still exists.
As a desktop, I created a temporary file and copied the Jar into this tempfile. But now Tempfile will not be deleted.
I read that if ClassLoad is a GC, loaded banks can be deleted.
Does anyone have an idea how to delete this file?
source
share