G
Grzesiek
Hi,
How to update a running jar file? I tried it that way:
Here is my Update.class:
import java.io.*;
import java.util.*;
import java.util.zip.*;
import java.util.jar.*;
public class Update {
public static void main(String args[]) {
System.out.println("Hello Mike");
File oldFile = new File("appU.jar");
File newJar = new File("appU1.jar");
oldFile.delete();
newJar.renameTo(origFile);
}
}
Typing
javac Update.java
jar cfe appU.jar Update Update.class
I also created appU1.jar file. appU.jar should update itself to
appU1.jar while running appU.jar.
But it doesnt work. Any ideas how to do it?
Best regards,
Grzesiek
How to update a running jar file? I tried it that way:
Here is my Update.class:
import java.io.*;
import java.util.*;
import java.util.zip.*;
import java.util.jar.*;
public class Update {
public static void main(String args[]) {
System.out.println("Hello Mike");
File oldFile = new File("appU.jar");
File newJar = new File("appU1.jar");
oldFile.delete();
newJar.renameTo(origFile);
}
}
Typing
javac Update.java
jar cfe appU.jar Update Update.class
I also created appU1.jar file. appU.jar should update itself to
appU1.jar while running appU.jar.
But it doesnt work. Any ideas how to do it?
Best regards,
Grzesiek