I need some help with using the following code to modify and existing jar file:
String command = "cmd /c jar uf " + dirToModify + " " + Main.getMain().outputLocate.getSelectedFile();
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
dirToModify = "C:\\Users\\Me\\Desktop\\myfile.jar"
Main.getMain().outputLocate.getSelectedFile() = "C:\\Users\\Me\\Desktop\\myfolder"
Basically I want to add the files/folders from myfolder
to myfile.jar
but with the above code it will add a shortcut to my C:
drive not the files from myfolder
.
Also I did look at other posts but none help me with this problem.
Any help with this would be greatly appreciated.