CLASSPATH“引导条目”和“引导条目”之间有什么区别? 和“用户条目” 在日食中?
Eclipse 有一个带有“类路径”选项卡的“运行配置”屏幕。
我在此选项卡的“用户条目”部分中列出了一些 jar,但直到我将这些 jar 文件复制到“引导条目”部分中后,我的项目才运行。 当两个部分都列出 jar 后,项目就成功运行了。
为什么?
这两种不同类别的类路径设置有什么区别?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
区别在于它们在类加载器中的规范顺序。
当启动将执行应用程序的虚拟机时,引导类路径由顶级类加载器管理。 (在命令行中,这是使用 -Xbootclasspath 指定的)
用户类路径是由应用程序类加载器管理的条目。
引导类路径中的任何条目都优先于用户类路径。
这些是根据包含要启动的应用程序的项目进行初始化的,但是您可以在要在 Eclipse 中启动的应用程序的启动器配置中修改它们。
至于为什么它不起作用:罐子是什么? 它们是需要从运行时类(例如 xml 解析器替换库)加载的东西吗?
请参阅 http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html 了解更多详细信息。
——斯科特
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
你能以两种方式生成 jar 文件吗?提取它们并比较它们。 我非常好奇当您添加该条目时 jar 文件是否发生了变化。 有关 的一些信息类加载可能会提供一些见解。 jar 文件规范 并没有真正提供任何提示。
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 loading might offer some insight. The specification for jar files doesn't really offer any hints.
其中之一用于检查编辑器中的源/类路径,另一个用于运行时环境。
我认为。
算了,反正今天我已经满头大汗了。
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.