Java to modify and then package back to the jar after the jar package has been recompiled __java

Source: Internet
Author: User
Java modified and packaged back to jar after the jar package has been recompiled

1. Get a jar package to be modified

2. My environment is windows, then unzip this jar package, get a bunch of class files, this time to find the class file you need

3. I first use the Jd-gui tool to look at this class file, then copy it, paste it into a Java file, and then edit the file the way you want it to.

4. cmd command to pull out the terminal, using the Javac modified Java file path---"To get the class file again

5. Reuse Jar CVF Test.jar A test.jar is the generated jar A is the folder name, he also has a B folder, the complete directory structure is a/b/example.class the purpose of this command is to take A.B as a package Name in the jar inside.

6. All right, here we are.

If the following error occurs in the project:

Unsupported Major.minor version 51.0 This is because you are compiling a jar package environment that is not in the same version as the Java environment you are working on, and adjusting to the same can solve the problem.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.