读书人

Java璋- java 圭

发布时间: 2013-01-27 13:55:24 作者: rapoo

Java璋--- java 圭涓?澶ar?

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 selectWindow->Show View->Other...

Java璋- java 圭涓?澶ar?

Second, under theClasspath Helpercategory, select theClasspath Helper View,Location By Location View, orPackages View

Java璋- java 圭涓?澶ar?

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 selectedmodel(which initially is taken from the currently selected Java Project from youPackage Explorerview).

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璋- java 圭涓?澶ar?

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

Java璋- java 圭涓?澶ar?

Unresolved ClassesJava璋- java 圭涓?澶ar?

The highlighted region shows a jar and class file decorated with aJava璋- java 圭涓?澶ar?. This indicates that a reference to a class cannot be resolved (found) on the current classpath. In this example, a class calledanunresolvedjar.ClassMissingFromJarcannot be found. At runtime this would lead to either ajava.lang.ClassNotFoundExceptionor ajava.lang.NoClassDefFoundError. In either case, the classanunresolvedjar.ClassWithMissingDependencycannot be loaded.

Blocked (Obscured) ClassesJava璋- java 圭涓?澶ar?

The first highlighted region (next to theJava璋- java 圭涓?澶ar?) shows jar and class file decorated with aJava璋- java 圭涓?澶ar?. 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 classajar.DependsOnFilesFromFolderwill actually be loaded fromC:\Development\Sample\demoarea\ajar.jar.

In the second highlighted region (next to theJava璋- java 圭涓?澶ar?) we can see the classajar.DependsOnFilesFromFolder. Although not a critical problem with the classpath, it could be confusing if the jarC:\Development\Sample\demoarea\ablockedjar.jaris updated with a new instance ofajar.DependsOnFilesFromFolderas the newer class will never get loaded into the JVM.

Blocked (Obscured) Classes with different versionsJava璋- java 圭涓?澶ar?

The first highlighted region (next to theJava璋- java 圭涓?澶ar?shows a folder and class file with aJava璋- java 圭涓?澶ar?. This indicates a class is 'blocked' or 'obscured' on the classpath. This is essentially the same as a yellow rectangle with one addition. The red color is also an indication that the version of the class at this location (C:\Development\Sample\demoareain this example) is different from the version that will actually be loaded (fromC:\Development\Sample\buildin this example). As with a yellow rectangle, the folder shown below theblockedclass is the location where the class will actually get loaded from.

As with the previous example, the second highlightJava璋- java 圭涓?澶ar?is showing the folder where the actual class will get loaded from. Of course blocking locations will always be above (appear earlier) in the classpath.

Unreferenced ClassesJava璋- java 圭涓?澶ar?

Classes decorated with theJava璋- java 圭涓?澶ar?image indicates a class that is not referenced by any other class. In the above imageafolder.AClassWithDependenciesis not referenced by any other class. Keep in mind that this information is based solely on references maintained within the classfile itself.There are several notable cases where class files are referenced but this will not be indicated including:

读书人网 >编程

热点推荐