Description: The following example uses the Eclipse development tool.
When writing large-scale Java project, it is common to refer to some other Java project (the purpose: to avoid duplication of code, improve the rate of reuse of code), there are two ways of reference (assuming the original project is Baidu, you need to refer to the project is P, that is, p to reference Baidu Project):
Method 1: Make the Baidu project into a Baidu.jar, and then put it into the class library of project B;
Disadvantage: Can not view the source code of Baidu Project;
Method 2: Direct Baidu Project into p, the specific steps are as follows:
<1> Click P Project Right---->build path--->configure Build path ...
<2> Select projects, such as
<3> Click the Add button to select the items you want to add or import in the following screen
<3> This allows you to refer to project A in the new project (that is, the Baidu project in the diagram).
The class presentation in the Baidu project----p refers to the Makecomplexmap method inside the Maptest.java:
Quote Baidu in Project P
Select Maptest, click F3, you can see the source of Maptest.java.
Java Project References Java project