Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between CLASSPATH "bootstrap entries" and "user entries" in Eclipse?

Eclipse has a Run Configurations screen with a Classpath tab.

I had some jars listed in the "user entries" section of this tab but my project did not run until I duplicated those jar files into the "bootstrap entries" section. After the jars were listed in both sections, the project ran successfully.

Why?

What's the difference between these two different categories of Classpath settings?

like image 962
Michael Jay Avatar asked Apr 19 '09 02:04

Michael Jay


People also ask

How do I change bootstrap entries in eclipse?

Go to Window-> Preferences -> Java -> Installed JREs and remove the earlier version of Java from there.

Do we need to set classpath in eclipse?

In Eclipse, you must set the classpath variables and configure the Eclipse Tomcat Plugin.

What is classpath in Java Eclipse?

The. classpath file is used to record all the information of the project compilation environment, including: source file path, storage path of the compiled class file, dependent jar package path, running container information, dependent external project and other information.


1 Answers

The difference is the order of their specification in the classloaders.

The bootstrap classpath is managed by the top-level classloader when starting the VM that will execute the app. (From a commandline this is speicfied using -Xbootclasspath)

The user classpath are entries that are managed by the application classloader.

Any entries in the bootstrap classpath take precedence over the user classpath.

These are initialized based on the project containing the application to launch, but you can modify them in the launcher configuration for the application you wnat to launch in eclipse.

As to why it didn't work: what were the jars? Were they things that needed to be loaded from the runtime classes (like xml parser replacement libs?)

See http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html for more details.

-- Scott

like image 105
Scott Stanchfield Avatar answered Oct 10 '22 16:10

Scott Stanchfield