views:

45

answers:

1

I know that, under typical conditions, a class is only loaded once. I also know that classes are immutable. Thus, once the class is loaded, it cannot be changed unless it is reloaded (which typically doesn't happen).

Does the same thing hold true for Jars? What happens if a Jar is updated while a JVM is still running that had previously loaded classes from the Jar?

+1  A: 

Nothing, if a class in that jar is used, the same definition remains, if a new class is loaded in the updated jar it will be taken.

OscarRyz
It sounds like you could end up with JVM with some original classes and some updated classes, depending on when the Jar is updated and when the classes are loaded. What implications might that have on a running application?
Jim Hurne
@Jim Hurne: Yes you can. The implications are random MethodNotFound exceptions
WW