twitter-bootstrap Eclipse 中的 CLASSPATH“引导程序条目”和“用户条目”有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/764725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's the difference between CLASSPATH "bootstrap entries" and "user entries" in Eclipse?
提问by Michael Jay
Eclipse has a Run Configurations screen with a Classpath tab.
Eclipse 有一个带有类路径选项卡的运行配置屏幕。
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.
我在此选项卡的“用户条目”部分中列出了一些 jar,但直到我将这些 jar 文件复制到“引导程序条目”部分后,我的项目才运行。在两个部分都列出了 jars 之后,项目就成功运行了。
Why?
为什么?
What's the difference between these two different categories of Classpath settings?
这两种不同类别的 Classpath 设置有什么区别?
采纳答案by ojblass
Can you generate the jar file both ways extract them and compare them. I am horribly curious if the jar file changed when you added the entry. Some information on class loadingmight offer some insight. The specification for jar filesdoesn't really offer any hints.
你能用两种方式生成jar文件吗?提取它们并比较它们。我非常好奇在您添加条目时 jar 文件是否发生了变化。关于类加载的一些信息可能会提供一些见解。jar 文件的规范并没有真正提供任何提示。
回答by Scott Stanchfield
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)
启动将执行应用程序的 VM 时,引导类路径由顶级类加载器管理。(从命令行这是使用 -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.
这些是基于包含要启动的应用程序的项目进行初始化的,但您可以在启动器配置中修改它们,以便在 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?)
至于为什么它不起作用:罐子是什么?它们是需要从运行时类加载的东西吗(比如 xml 解析器替换库?)
See http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.htmlfor more details.
有关更多详细信息,请参阅http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html。
-- Scott
——斯科特
回答by Charlie Martin
One of them is for checking the sources/classpaths in the editor, the other is for the runtime environment.
其中一个用于检查编辑器中的源/类路径,另一个用于运行时环境。
I think.
我认为。
What the hell, I'm maxed out today anyway.
什么鬼,反正我今天已经用完了。

