The order in which the Loader class will load the classes in this script

I added lombok to java project in eclipse . I needed to add the last two lines in the eclipse.ini file as vmargs .

 -showlocation -vm /home/$USER/JavaSE8/jdk1.8/bin/java -startup plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20150204-1316 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.6 -Xms500m -Xmx2g -Dorg.eclipse.swt.browser.XULRunnerPath='' -javaagent:/home/$USER/eclipse/4.4-luna-SR2/lombok.jar -Xbootclasspath/a:/home/$USER/eclipse/4.4-luna-SR2/lombok.jar 

I also added lombok.jar to libraries (Project → Properties → Libraries), and also moved lombok.jar to the highest level on the Order and Export tab (Project → Properties → Order and Export) in eclipse and JRE System Library (rt .jar, resources.jar, etc.) all below lombok.jar . I am confused by the order in which the lombok main class will be loaded as:

  • When eclipse starts, the Bootstrap class loader must load all the JDK classes in the JRE directory. (But since I moved lombok.jar up to Order and Export, above the JRE system libraries, rt.jar will be loaded after lombok.jar . Basically not? Because loading libraries should always be loaded first no matter what!)

  • Since we also redefined the bootstrap classpath with the -XBootstrapClasspath option, lombok.jar will load the Bootstrap Classloader .

  • After that, the Extensions classloader loads the classes into the lib \ ext JRE directory.

  • Then the System-Classpath classloader loads all the classes and banks defined by the CLASSPATH environment variable (Does this load take into account the order of the Order and Export libraries?)

Please correct me if I misinterpret things here, as I'm just a beginner trying to understand the maze of ClassLoading.

+5
source share
1 answer

You often mention "order and export." I assume that you mean the same tab in the project path dialog box. As far as I know, this only applies to the visibility of the project library for other projects that depend on this project. This has nothing to do with how the eclipse itself loads.

0
source

All Articles