As the application scale increases, the number of jar packages that are dependent on is also greatly increased, many of which are redundant and cannot be used. Jar package occupies a large amount of valuable space. With the loosejar tool, you can easily find Jar package ~
Loosejar uses classloader. Which of the following is used when the application is running? Class, classloader will load the. Class file of this class into JVM, and then generate a class pair And then use reflection to execute the class method, so which. class files are loaded Classloader is clear. With this feature, you can know the actual usage of classes in the jar package. And the actual usage of the jar package in the application.
Step 1: Put loosejar. jar in the Lib under the application's WEB-INF, for example, the path is
D:/workspaces/appnotify/webroot/WEB-INF/lib/loosejar. Jar
Step 2: Configure-dfile. Encoding = uft8 in JDK of installedjres in IDE
-Javaagent: D:/workspaces/appnotify/webroot/WEB-INF/lib/loosejar. Jar
Step 3: start the application and test your application with full path coverage as much as possible.
Line.
Step 4: In the JDK installation path, select the port of Bootstrap in the jconsole in the bin folder.
Select com. googlecode. loosejar under mbean and click summary to view the analysis result ~