简体   繁体   中英

Jar file on Mac OS X

I have a jar file that is used by a Java program. It has all the preferences and stuff (it's not an executable). I used archive utility to uncompress it and i edited the files. Now I need to put them back in the jar the same way so the Java program can use it again. How can I do that? Thanks.

The command-line jar utility has its own man page ( man jar at the Terminal prompt to see it.) You will have to make sure to tell it about the MANIFEST.MF file, if any, so it gets handled correctly.

Alternatively, jar files are just (usually uncompressed) PKZIP files, and Mac OS X comes with a zip client. Just something like this would be fine:

zip -r0 filename.jar dir1 dir2 dir3

where dir1, dir2, dir3 are the directories you want to be zipped up and appear at the top level of the jar file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM