Creating Dependencies Between Projects

See Also 

When creating Java applications you typically set up a single main project which contains both the project main class and any required projects. Whenever you create separate  for each of a project's source roots, you have to set up the classpath dependencies between the main project and the required projects. A required project is a project that has been added to another project's classpath.

Whenever you clean and build a project, the IDE also cleans and builds its required projects. The required project's attached Javadoc and source code are also made available to the project that you are building.

To configure project dependencies:

  1. In the Projects window, expand the node of the project to which you want to add a dependent project.
  2. Right-click the Libraries node and choose Add Project.
  3. Select the directory containing the project whose JAR files you want to add to the classpath. When you select the project directory, the project name and project JAR files are displayed in the dialog's right pane.
  4. Click Add Project JAR Files.

    The IDE adds the dependent project to the primary project's classpath and display a node for it within the Projects window's Library node.

See also
Managing the Classpath
Setting the Main Class and Runtime Arguments
About Standard Projects
About Free-Form Projects
Adding Javadoc to a Project

Legal Notices