Forums Register Login

I need help with custom ClassLoader's

+Pie Number of slices to send: Send
Okay here is my problem. Imagine a program that is similar to a web browser. Instead of this program loading webpages it loads class files and shows them. Now imagine this class file changing while its still loaded into the browser, so it needs to be reloaded. But the problem is that the class which is already loaded gets instantiated again and the new class never gets loaded. Here is some very basic code to describe my problem.
If you wanna help me out, run this program and then press the load class button. Now open the source code of the MyPlugin.java and change the System.out.println() line to display something else and recompile that file. Now go back to the program that should still be running and hit load class again. What happens is that the new class isn't loaded, you get the cached memory copy of the old one. Can somebody help me figure out how to load the new class in from disk please. Thank you!




Thanks In Advance,
Frank
Bras cause cancer. And tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 838 times.
Similar Threads
New Java, old CORBA
Executing Singleton class with Custom Class Loaders
java class loader basic question..
why not load class
Not able to load Class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:28:25.