Solved

How to unload a JAR file that was used within a URLClassLoader?

Posted on 2002-03-25
2
2,039 Views
Last Modified: 2013-11-18
Hi all,


In an application I'm developing, we need to invoke "Plugins", these plugins are installed outside of the scope of the application's CLASSPATH. I'm currently using the URLClassLoader in order to instantiate the main class of each plugin. However, the problem with this is that while I've tried to remove any reference to the URLClassLoader when I'm done with a plugin, the JAR file used by the late URLClassLoader is still locked! Only when I completely exit my JVM the file gets released.

My question is: Should I write my OWN ClassLoader that will release the JAR files after first caching their contents, or is there a way to FORCE/HINT the JVM to release these JAR files?


Thanks in advance,
Doron Barak
0
Comment
Question by:doronb
2 Comments
 
LVL 9

Author Comment

by:doronb
ID: 6893713
Hello again,

Check the following question to see a sample of how I use URLClassLoaders:

  http://www.experts-exchange.com/java/Q.20280834.html


Thanks,
Doron Barak
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 300 total points
ID: 6894083
> My question is: Should I write my OWN ClassLoader

IMHO you have to write your own classloader
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySqlDump not dumping triggers 1 43
hibernate example using maven 12 56
Which non-HTML GUI front end to use with Java? 3 24
JAVA API design with micro service cloud in mind 1 41
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question