How to turn folder into jar - Code

jar, java

Solution

This worked for me for a MAC OSX:

Open Terminal at the folder with the jar file and run the following commands

 unzip mylib.jar -d jarfolder 

 //You can then change whatever you need and finally run the command below

 jar cvf mylib.jar -C jarfolder/ .

Problem

Hi im busy on a application that decompiles a jar the pastes files into the folder of the decompiled jar, it then compresses the folder into a jar. Decompiling and copying works, but i can't manage to get the folders contents to be jared (compressed into jar), i did about 3hrs research and found only outdated methods. please help. -Regards marko5049 EDIT MORE INFO: I apologize i mean i cant get my application to turn a folder into a jar file, my application is an modification installer for a jar file. and it extracts the jars files, then adds the modification and then, is supposed to then turn the folder back into a jar file so that the modification is installed. The jar file is not executable.

Original source

Related problems