This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Reload a modified java class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Reload a modified java class " Watch "Reload a modified java class " New topic
Author

Reload a modified java class

Manu Somasekhar
Ranch Hand

Joined: May 22, 2012
Posts: 30
Hi,

I was doing some byte code injection with asm. I tried to inject some code to the class file. But it is found that if I tried to find the injected code, it is not available within the already loaded class. So a clean restart of JVM is required to find the injected code within the object.
So I was wondering how can I reload a class without restarting the JVM ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

Byte code injection and class loading aren't really beginning topics, so I'm going to move this thread.
Manu Somasekhar
Ranch Hand

Joined: May 22, 2012
Posts: 30
Thanks Paul.

Once again I am answering to my own question.

In order to achieve what I mentioned, one needs to extend ClassLoader and try to reload the classes when ever required.

I got the answer from here


webpage
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reload a modified java class
 
Similar Threads
unload class from JVM
How to unload a class/jar from the classpath under Weblogic environment
nonintrusive in spring
[Struts 2] execute not called - strange error message
use of JavaBean in JSP