java中编译时库和运行时库的区别是什么? [英] What's the difference of compile time libraries and run time libraries in java?

查看:118
本文介绍了java中编译时库和运行时库的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专业人士使用它们的概念是什么?

And what are the pro's con's of using either?

我实际上是在Project Properties> Libraries for Java Applications中的Netbeans中看到的。我们有两个选项卡,一个用于编译时库和运行时库,看起来我们可以相互独立地添加一个库

I actually saw it in Netbeans under Project Properties > Libraries for Java Applications. We have two tabs, one for compile time libraries and run time libraries, and it looks like we can add a library to either independent of each other

推荐答案

Libraries属性对话框的UI和术语非常令人困惑。

The UI and terminology of the Libraries properties dialog is pretty confusing.

该对话框上的帮助按钮将为您提供相当多的信息。

The Help button on that dialog will give you a fair bit of info.

编译时库列表可能是运行时库列表的子集。

The Compile-time library list may be a subset of the Run-time library list.

考虑这种情况。 ..

Consider this situation...

您有源代码从库'widgets.jar'导入类。 widgets.jar中的类文件引用jar文件'xml.jar'中的符号。如果你的源代码没有从xml.jar导入类,你可以定义编译时库列表只包含widgets.jar。

You have source code that imports classes from on a library 'widgets.jar'. The class files in widgets.jar reference symbols from the jar file 'xml.jar'. If your source code does not import classes from xml.jar, you could define the Compile-time libraries list to contain just widgets.jar.

当你尝试运行你的在项目中,您可能需要在运行时库列表中包含xml.jar以防止ClassNotFoundException。

When you try to run your project, you will probably need to include xml.jar in the Run-time libraries list to prevent ClassNotFoundException's.

这篇关于java中编译时库和运行时库的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆