As we all know, Eclipse's project Bulid path can refer to a third-party class library (1),
Figure 1
But there is a drawback to this approach: a reference to a class library is through an absolute path. If there are two computers (office 1, home 1), it is likely to cause eclipse error due to the different path of the class library.
But in fact, the two computers are just the absolute path of the libraries directory, the subdirectory starting from the libraries is fully synchronized.
As long as this condition is met, the class library can be introduced in the following way:
1. Establish CLASSPATH variable. The establishment of a new CLASSPATH variable (2) in window->preferences;
Figure 2
2. Select Add Varibale in the build path, then select the variable entry in the popup window and select Extend ... (3)
Figure 3
3. Select the desired class library in the variable extend window (4)
Figure 4
Thus, the class library is a relative path reference (5) based on the CLASSPATH variable,
Figure 5
As long as you can ensure that all class libraries on both computers are consistent with the relative path starting from a certain directory, you can create Eclipse classpath variable to ensure that the project will not be able to make an error by referencing the class library during the migration of the two computers.