Solved

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

Posted on 2002-03-25
2
2,022 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
Comment Utility
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
Comment Utility
> My question is: Should I write my OWN ClassLoader

IMHO you have to write your own classloader
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
countAbc challenge 9 49
Systems talking to each other 5 107
maven example error 3 34
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now