I like to use the ' v' (verbose) and ' f' (filename) options with all jar commands that I run so that the output will be verbose (to help see that something is happening and that it's the correct thing that's happening) and so that the applicable JAR/WAR/EAR filename can be provided as part of the command rather than input or output depending on standard input and standard output. Preparing the files to be used in the jar examples The next screen snapshot shows my.class files have been compiled and are ready to be included in a JAR.Ĭreating a JAR file The ' c' option provided to the jar command instructs it to. I have shown to be consistent with using command-line tools in this post. The actual source of these files is insignificant to this discussion and is not shown here. The next screen snapshot demonstrates compiling some Java source code files (.java files) into.class files. It's also worth keeping in mind that the jar options tend to mirror tar's.įor my examples, I want to jar up and work with some.class files. It's also worth keeping in mind that the is based on the ZIP format and so the numerous tools available for working with ZIP files can be applied to JAR, WAR, and EAR files. JAR files will be used primarily in this post, but the commands I demonstrate on.jar files work consistently with.war and.ear files. In this post, I look at use of the to create, view, and manipulate Java archive files. This is particularly true when I have to do something repeatedly or when I am doing it as part of a script. Although Java IDEs and numerous graphical tools make it easier than ever to view and manipulate the contents of Java archive (JAR, WAR, and EAR) files, there are times when I prefer to use the command-line to accomplish these tasks. Learn how to do basic CRUD operations on JAR, WAR, and EAR files using the command line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |