I have extracted a jar file and made some change on it. Now, how can i compress again it as an executable jar file?
Thanks.(Sorry for my bad english.)
I have extracted a jar file and made some change on it. Now, how can i compress again it as an executable jar file?
Thanks.(Sorry for my bad english.)
Try :
jar cf jar-file input-file(s)
according to http://docs.oracle.com/javase/tutorial/deployment/jar/build.html
jar cf fileName.jar FOLDER_NAME/
–
Hoodoo By Using Eclipse IDE You can Create your jar file
Below i have one link from which you can learn how to make jar file executable
https://www.cs.utexas.edu/~scottm/cs307/handouts/Eclipse%20Help/jarInEclipse.htm
But For that You have to make project in Eclipse.
You can use this very simple library to pack/unpack jar file programmaticaly
Very simple
import java.io.File;
import java.util.List;
import fr.stevecohen.jarmanager.JarUnpacker;
class Test {
JarUnpacker jarUnpacker = new JarUnpacker();
File myfile = new File("./myfile.jar");
File unpackDir = new File("./mydir");
List<File> unpacked_files = jarUnpacker.unpack(myfile.getAbsolutePath(), unpackDir.getAbsolutePath());
}
You can also use maven dependency
<dependency>
<groupId>fr.stevecohen.jarmanager</groupId>
<artifactId>JarManager</artifactId>
<version>0.5.0</version>
</dependency>
Check the last version with the link bellow to use the last dependency
Please use my public issue tracker if you find some bugs
jar cvf filename.jar *
https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
© 2022 - 2024 — McMap. All rights reserved.