Standard IDE projects are essentially modular. If your application needs to be built into just one JAR file, you can build it with a single project. If your application exceeds that scope, you can build your application from multiple IDE projects that are linked together with one of those projects declared as the main project. Setting the Main ProjectThe main project is the one that project-specific commands (such as Build Main Project) in the main menu always act on. When an application is composed of many related projects, the main project serves as the entry point for the application for purposes of compiling, running, testing, and debugging. You can have only one main project set at a time. To make a project the main project, right-click that project's node and choose Set Main Project.
Creating SubprojectsFor more complex applications, you might need to create multiple IDE projects, where one project is the application entry point that depends on other projects. (Any project that has another project depending on it functions as a subproject, though it is not specifically labeled as such in the IDE.) Each IDE project can create one distributable output (such as a JAR file), which in turn might be used by other projects. There is no particular limit to how long a chain of dependencies can be, though the chain must not be circular. (For example, if project A depends on classes in project B, project B cannot depend on classes in project A.)
To make one project dependent on another project:
|