1. What do you mean by "doesn't work"?
2. What are you trying to accomplish?

Any classes loaded from the jar won't be reloaded just because their
definition changes on the disk. Also, it's quite possible that the class
loader has kept the jar file open, which means that

On Windows, you won't be allowed to delete the jar file
On Unix-like systems, you'll be able to delete and replace it, but the
class loader will still be reading from the old file until it's closed.

It's also possible that the classloader closes the jar (to save open files
on system where their number is limited) but keeps the file's index
information in memory. Now replacing the jar file can lead to errors
loading new classes, because they almost certainly begin at a different
offset.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!