Replacing jar files real-time in classpath

Hi All

I have a swing application and It runs perfectly. I have created a update manager that can download jar files for the application. This update manager downloads jar files and replaces the jar files that are currently in the class path. You could say the update is real-time.

After the files are downloaded I get errors like class not found and other really strange Java errors. The class not found errors indicate that the application cant find classes that are in the downloaded jar file.

Is there any way to prevent this from happening?

Thanks in advance,

Martyn Hiemstra

[619 byte] By [martynhiemstraa] at [2007-11-27 8:42:06]
# 1
How have you implemented the real-time update? Are you just replacing files or do you have a way to make the JVM reload the classes?Maybe it is better to restart the JVM.
tom_jansena at 2007-7-12 20:41:19 > top of Java-index,Java Essentials,Java Programming...
# 2

I am currently just saving the downloaded files into the classpath directory, so in short I'm replacing them while the JVM is running.

The problem is that my Java application is installed using install4j meaning that the application is started as a .exe file. The problem is that I would need to create an external application to update the files but the external programme would have not idea where to put the newly downloaded files. T o overcome this all I want to create an updater within my own application.

Is there a way to shutdown real-time loading of jar files in the class path? That would solve the problem since the newly loaded jar files arent detected until the application is started again.

martynhiemstraa at 2007-7-12 20:41:19 > top of Java-index,Java Essentials,Java Programming...
# 3
How about using Java Web Start to transfer the JAR files from the Web server to the swing client?
karma-9a at 2007-7-12 20:41:20 > top of Java-index,Java Essentials,Java Programming...
# 4
I'm going to look into it immediatly, thanks for the tip.
martynhiemstraa at 2007-7-12 20:41:20 > top of Java-index,Java Essentials,Java Programming...