javaeclipsepathclasspatheclipse-classpath

Eclipse adding a Class path variable/Library to Eclipse preferences vs. adding a path to an specific project


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?


Solution

  • 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.