[JAVA] Add files to jar files

Overview

Technique to use when there is a missing file in the completed jar file or you want to change the property a little

View the contents of the jar file

If you want to update the file, display the list of files in the jar and check the path of the target file

jar tf XXXX.jar

Add (update) the file to the jar file

For example, how to add log4j.propreties to the root directory of jar as follows

jar uvf XXXX.jar log4j.properties

Add (update) files to the jar file (subdirectory edition)

If it is in a subdirectory of a directory, dig the directory at hand, place the file, and then execute the command.

For example, like this. If you want to update the java file, compile java at hand to generate a class file and then update (.java file should not work)

jar uvf XXXX.jar org/apache/log4j/FileAppender.class

Recommended Posts

Add files to jar files
Introduction to JAR files
How to add local jar to maven pom.xml
How to add jar file in ScalaIDE
Summary of jar files
Introduction to jar command
Add jar file obtained from Maven to IntelliJ
A story about trying hard to decompile JAR files
[Rails 6] Add images to seed files (using Active Storage)
How to add ActionText function
4 Add println to the interpreter
[Rails] Add column to devise
How to add HDD to Ubuntu
How to rollback migration files
How to use Maven to place resource files outside the JAR
How to add Hyperledger Iroha Peer
Add Extended Attributes to the file
Add multi-letter watermark to Java Word
How to add columns to a table
How to disassemble Java class files
[Rails] How to add new pages
How to decompile java class files
Add a time stamp to the JAR file name in Gradle
Add image selector to Selenium Grid
Add watermark to Java to PDF document
[Rails] Add strong parameters to devise
Add processing to original annotation to Jackson
[Java] Add WordArt to Word document
How to add the delete function
Handle CSV files uploaded to GCS
to_ ○
Add / remove watermark to Java PowerPoint
Add the pre-built jar library to Android and call it in the framework
[Xcode] How to add a README.md file
How to share files with Docker Toolbox
How to use binding.pry for view files
Migration file to add comment to Rails table
Add foreign key to column with migrate
Run Embulk on Docker to convert files
[Java] How to add data to List (add, addAll)
How to add a new hash / array
Java-How to compare image files in binary
* Android * Saving / loading files to internal storage
[Java] How to output and write files!
I wanted to add @VisibleForTesting to the method
Convert SVG files to PNG files in Java
[Docker] Copy files from docker container to host
[Rails] [Memo] When to add = to <%%> and when not
Add Document to Azure Search Service (Java)
Try to implement UIAlertController by separating files
Add footnotes to Word documents in Java
Add scripts to distributions created with gradle
How to add application version information to Sentry information
Add spring boot and gradle to eclipse
Steps to register Java files on GitHub
Add SameSite attribute to cookie in Java