Eclipse将类路径变量/库添加到Eclipse首选项与添加特定项目的路径(Eclipse adding a Class path variable/Library to Eclipse preferences vs. adding a path to an specific project)

我想知道通过“1)Eclipse >> Preferences >> Java >> Build Path >> Add Class path Variable / Library”添加类路径/库之间的区别,并通过添加类路径/库来添加它一个特定的项目“2)左键单击项目>>属性>> Java构建路径>>添加库或添加类路径”?

如果这些方法不同。 我应该如何使用它们?

I want to know what is the difference between adding a class path/library by "1) Eclipse>>Preferences>>Java>>Build Path >> Add Class path Variable/Library", and adding a classpath/library by adding it to an specific project by "2) Left-Click on the Project >> Properties>> Java Build Path >> Add Library OR Add class path"?

If these methods are different. How should I use each of them?

最满意答案

'Preferences'类路径/库条目只定义变量和库的名称和内容。 这不会将这些条目添加到任何项目的构建路径中。

在Preferences中定义变量和库之后,可以使用Project Properties Build Path将它们添加到各个项目中。

在“首选项”中使用单独的定义可以更改变量/库的实际值,而无需更改每个项目。

The 'Preferences' Class path / Libraries entries just define the names and contents of variables and libraries. This does not add these entries to the build path of any project.

Once you have defined variables and libraries in the Preferences you can then add them to individual projects using the Project Properties Build Path.

Using a separate definition in the Preferences allows you to change the actual value of the variable / library without having the change every project.

更多推荐