gpt4 book ai didi

java - 如何在项目中找到不需要的jar

转载 作者:搜寻专家 更新时间:2023-10-31 08:26:30 28 4
gpt4 key购买 nike

我的项目中有一些 jar 。我想知道这些 jar 是如何使用的,或者如果我把它们去掉会有什么影响?

最佳答案

您可以使用 loosejar 来实现它.

It is a simple Java Agent that can be used to discover unnecessaryjars lying on application classpath. It performs per classloader JVMheap analysis and displays its results. loosejar can be safely usedduring development, QA, UAT or even in production as it doesn't modifythe state of the JVM at all and adds no overhead.

使用方法:

  1. Start your application or application server with-javaagent:loosejar.jar flag (loosejar.jar should obviously point to the correct path of the actual jar)

  2. Exercise your application to make sure that the classes get loadedinto the JVM.

  3. Get loosejar analysis results via JMX console (open jconsole and runcom.googlecode.loosejar.LooseJarMBean#summary() in MBeans folder) oron application shutdown (via regular console log).

关于java - 如何在项目中找到不需要的jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20879407/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com