I noticed that when running a Java application or unit test in Eclipse, it explicitly adds the jars of the JRE (rt.jar, etc.) to the -classpath
argument of java
.
First question: Why? This seems unnecessary, since those jars are implicitly on the bootstrap classpath anyway, right?
Second question: Is there a way to prevent Eclipse from doing that? I found that I can remove those jars from -classpath
by deleting the "JRE System Library" from the "Bootstrap Entries" in the Classpath tab for a specific run configuration, but I would like to configure this for the whole project, no for every run config separately.