zoukankan      html  css  js  c++  java
  • 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...

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

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

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

    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.

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

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

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

    Unresolved Classes

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

    The highlighted region shows a jar and class file decorated with a 去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客. 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

    去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客

    The first highlighted region (next to the 去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客) shows jar and class file decorated with a 去掉 java 项目中 多余的jar包 方法 - abcijkxyz - 余威的博客. 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.

  • 相关阅读:
    Java中如何利用File类递归的遍历指定目录中的所有文件和文件夹
    SQL的别名和SQL的执行顺序和SQL优化
    Linux中如何配置sudo用户
    Linux的ssh的known_host文件
    Linux的SSH服务
    Linux的图形模式和文本模式以及单用户模式切换
    Linux服务器磁盘空间占满问题
    PLSQL Developer连接本地Oracle 11g数据库
    Linux常用命令学习
    OAuth2 .net MVC实现获取token
  • 原文地址:https://www.cnblogs.com/bjanzhuo/p/3576045.html
Copyright © 2011-2022 走看看