Solve multiple versions of the jar package jar package conflicts within [rename]

demand:

  New features in the original system, the original system using an older version of the jar, for some reason, the new function to import a new version of the jar. Jar requires two packages can coexist and affect each other.

Example: the original jar package: pdfbox-app-1.8.1.jar

  New jar package: pdfbox-2.0.15.jar

Solution: The new package name in the jar package to rename

Preparation: Download jarjar.jar [I use the version jarjar-1.4.jar]

1, the jarjar-1.4.jar and pdfbox-2.0.15.jar in the same directory, open cmd, assigned to the current directory

2, the new document in the current directory rule.jar, content [rule org.apache.pdfbox. ** org.apache.pdfbox_2_0_15. @ 1], the format is a rule + space + the original package name + ** + space + the new package name + @ 1

3, execute the command in cmd [java -jar jarjar-1.4.jar process rule.txt pdfbox-2.0.15.jar pdfbox-2.0.15_new.jar]

Import jar package to the newly generated in the project, the name of the jar package can be customized.

Guess you like

Origin www.cnblogs.com/gode/p/11088815.html