Eclipse 简明教程
Eclipse - Java Build Path
Setting the Java Build Path
在编译 Java 项目时使用 Java 构建路径来发现依赖类。它由以下项组成:
The Java build path is used while compiling a Java project to discover dependent classes . It is made up of the following items −
-
Code in the source folders.
-
Jars and classes folder associated with the project.
-
Classes and libraries exported by projects referenced by this project.
可以通过使用 Java 项目属性对话框的 Java 构建路径页查看和修改 Java 构建路径。
The java build path can be seen and modified by using the Java Build Path page of the Java Project properties dialog.
为了打开 Java 项目属性对话框,在程序包资源管理器视图中右键单击 Java 项目,并选择属性菜单项。在左侧树中选择 Java Build Path 。
To bring up the Java Project properties dialog box, right click on a Java Project in the Package Explorer view and select the Properties menu item. On the left hand side tree select Java Build Path.
在开发 Java 应用程序时看到的常见需求是向 Java 构建路径添加现有 JAR。这可以通过使用“库”选项卡完成。在“库”选项卡中,如果 JAR 已在 Eclipse 工作台中,只需单击 Add JARs ;如果 JAR 在文件系统的其他位置,则单击添加外部 JAR。
A common requirement seen while developing java applications is to add existing jars to the java build path. This can be accomplished using the Libraries tab. In the Libraries tab, just click on Add JARs if the jar is already in the Eclipse workspace or click on Add External JARs if the jar is elsewhere in the file system.