1. Open the jar with the compressed file, find the class file to be modified, and view the source code through the source code tool.
Scenario: Modify the FontMapperImpl.class file in pdfbox-2.0.22.jar
1.1 Open the jar package with 360 compression
1.2 Drag FontMapperImpl.class to the decompilation tool, view the source code, here use Idea directly
2. Create a new blank project decompilatoin (start from any name)
3. Create a new package in decompilatoin, the structure is the same as that of the source code. New java and decompiled source code are the same
In the above class file, you can know the package: org.apache.pdfbox.pdmodel.font, create the same package, and the same java file
4. As the above java file reports an error. Just after importing the source jar package
4.1 The pom.xlm file is introduced into the jar package
4.2 The java file does not report an error
5. Modify the java file
For example, add print log in FontMapperImpl.java
6. Compile java files to generate class files
Click compile to compile
and generate class files in target