How to let Eclipse import two identical projects at the same time? Eclipse imports two projects
Recently, I thought about importing two identical projects in Eclipse at the same time. If I find that the project name cannot be imported after the change, I will prompt that Eclipse has already imported the project, after discussion with colleagues, jiadu Niang Google, finally OK, haha, actually very simple, there is a project. open the project file with the editing tool,
Do you see <name> testAndroid </name>? Change the name and then import the package. Haha, isn't it easy!
How to run two java
Create a project in eclipse, place the two java files under a folder, and drag them to the eclipse project.
Set one of the classes as the primary class. For example, the main function is written in SocketServer. java, and then instantiate the SocketClient class in the main function, you can call the methods in the two classes, that is, run multiple java classes at the same time.
According to your situation, I think you two programs can be set to two threads.
Public class SocketServer
{
Static Thread s = new Thread (new Runnable (){
Public void run (){
// The method for putting the server here
}
});
Public static void main (String [] args ){
SocketServer. s. start ();
SocketClient. c. start ();
}
}
Public class SocketClient
{
Static Thread c = new Thread (new Runnable (){
Public void run (){
// Put the Client method here
}
});
}
How to import existing files to eclipse
There are currently three ways to add existing files to a project: the first is to Import files to the project using the Import function in the File menu of IDE, just like in IVJ. This is also recommended. The second is to drag files from the Windows Resource Manager to the project. The third is to directly copy the file to the project folder, select a project or folder in the Eclipse resource browsing window, and execute the Refresh from locate function ). It should be noted that the project folder can be placed anywhere on the computer, and the project path can be specified to an existing project folder by creating a project in Eclipse, then refresh in Eclipse. Note that any project folder can be created or specified only in Eclipse, even if you create a folder under the workspace path of the default storage project folder, you cannot change it into a project in the Eclipse environment. That is to say, this folder is invisible to Eclipse.