Solved

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

Posted on 2002-03-25
2
2,034 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 53
Java Jpanels and Jframe 8 33
javap not working 8 46
ejb on wildfly 5 20
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

810 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