as the scale of the application grows, the number of dependent jar packages is also significantly added. There is no shortage of unnecessaryjar package that takes up a lot of valuable space. by Loosejar this tool. You can easily find the "impostors"jar wrapped up ~
Loosejar works by using ClassLoader. As the application is executed, whichclass, ClassLoader will load the class. class file into the JVM and generate a class pairlike. You can then use reflection to execute the method of this class, so which. class files are loaded, ClassLoader is clear, using this feature, you can know the actual use of the class in the jar packageand the actual use of the jar packages in the application.
The first step: Place the Loosejar.jar in Lib under the application's Web-inf, for example, the path is
D:/workspaces/appnotify/webroot/web-inf/lib/loosejar.jar
Step Two: Configure the JDK in the installedjres inside the IDE-dfile.encoding=uft8
-javaagent:d:/workspaces/appnotify/webroot/web-inf/lib/loosejar.jar
Step three: Launch the app. Try to test your application with the full coverage of the path as much as possible so that each piece of code is
line.
Fourth Step: Under Install the JDK path. Jconsole in the Bin directory, select the port of Bootstrap, and
after selecting the Com.googlecode.loosejar under the Mbean click Summary, you can see the results of the analysis ~
Clean up redundant jar packages in your app with Loosejar