java项目删除多余jar包_Java程序调优---去掉 java 项目中 多余的jar包 方法

开发工具Eclipse

3.x

插件一:ClassPath Helper插件地址:http://classpathhelper.sourceforge.net/

Downloading ClassPath Helper

For starters, you need to download the Classpath Helper eclipse plugins. The files are packaged seperately as binaries and source code plugins. The source code plugins are not required for execution.

The latest version of Classpath Helper can be downloaded from source forge http://classpathhelper.sourceforge.net/downloads.html

Once you download the eclipse distribution zip file, you need to unzip it in your eclipse directory (it will automatically unpack itself in the appropriate subdirectory (i.e. plugins). From there (re)start eclipse. You can verify if the classpath helper plugins

are properly installed by selecting Help->About Eclipse SDK, select the "Plug-in Details" button.

Configuring Eclipse

Eclipse by default starts its VM with a very small heap and stack. This leads to some mysterous stack overflows from within Eclipse when plugins are performing long running jobs. This is a well documented bug within Eclipse that affects other plugins. The work

around is to increase the stack size upon eclipse startup.

eclipse.exe -Xms64m

Opening Classpath Helper Views

The Classpath Helper Views can be opened in any perspective with the following steps.

First, from the Menu select Window->Show View->Other...

3e9aa0114a0704105f748cb8f9ea3f2a.png

Second, under the Classpath Helper category, select the Classpath Helper View, Location By Location View, or Packages

View

f2b509694d1558c9e4cf1fdc28e529cf.png

The Classpath Helper View

The basic layout of this view should be a straight forward translation of the classpath. The classpath is based upon the currently selected model (which initially is taken

from the currently selected Java Project from you Package Explorer view).

Familar icons are used for Jar files and class folders. The order is represented top to bottom. The various decorations on these elements will be explained later.

84f5cd2619db540e538324361bb16213.png

This can be expanded to show the classes and interfaces within each jar or folder.

ef67699393e6997c29f8f201e3b92bfb.png

Unresolved Classes

63075bce408ab355f662eb498b0a912a.png

The highlighted region shows a jar and class file decorated with a

c05a3c2ea4f41fbfa927c82e4aa2a5fe.png.

This indicates that a reference to a class cannot be resolved (found) on the current classpath. In this example, a class called anunresolvedjar.ClassMissingFromJar cannot be found. At runtime this would lead to either

a java.lang.ClassNotFoundException or a java.lang.NoClassDefFoundError. In either case, the class anunresolvedjar.ClassWithMissingDependency cannot

be loaded.

Blocked (Obscured) Classes

7e9280bcb3d670d20829cc08ab6061a3.png

The first highlighted region (next to the

edc75b08ff00b558643744ff80fc79d9.png)

shows jar and class file decorated with a

fbd7e3bf98b9276781e8a4974d360363.png.

This indicates a class is 'blocked' or 'obscured' on the classpath. This means that the class/interface located at this location will never be loaded. Instead it is loaded from another location. In this instance, we can see that the class ajar.DependsOnFilesFromFolder will

actually be loaded from C:\Development\Sample\demoarea\ajar.jar.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值