How to transfer project written in Eclipse?

牧云@^-^@ 提交于 2019-12-23 10:26:52

问题


I was trying to move my project, which was written in Eclipse, to another computer. I tried declaring the right workspace, but the project doesn't appear in Eclipse.

Is there a way to transfer an entire project, or must I rebuild the project with its packages and transfer only the .java files?


回答1:


Follow the below steps to copy a project from one system to another:

  1. Copy the project folder to the destination system
  2. Create a workspace
  3. Select File -> Import
  4. Select General -> Existing project into workspace
  5. Select the project folder (under selected root folder)
  6. Say 'Finish'



回答2:


When transferring objects from one eclipse instance to another, the most important thing to move along are the .classpath and .project files. These define the structure of the project and the libraries needed to make it work.

Just copy your project folder to the other computer and follow these steps:

 1. Open Eclipse
 2. Go to File > Import
 3. Existing projects into workspace

The project should now be imported along with the sources

You can also Export the project and import it.

What would help you though is if you abstract the IDE file generation files to a build management tool like maven. This will help you to not keep (and eventually move-around) your project with its dependencies but rather just run a command to make it IDE ready.

If you are running eclipse, the command would mvn eclipse:eclipse




回答3:


copy the project folder.Then use File/Export, then File/Import.


回答4:


Export the project to a directory of choice on the current computer. Then, copy it to the other computer. Finally, import the project into Eclipse on the other computer.




回答5:


you can export the project and import it back into the new system. while exporting don't forget to check all the boxes so that all files are included in the package.




回答6:


You do not have to import anything

You must install JDK on the target computer. When you do this, there could be problems, but I just got the latest version and it worked for me. Make sure that you get the same version you were using previously, either 64bit or 32bit for windows.

If you are changing from windows to Mac or something like that, or the from 64 to 32 or vice versa, this probably won't work.

First, you need eclipse. Copy the eclipse folder over. You can do this anywhere.

Second, you need to locate your eclipse metadata folder. On your new computer, open eclipse and create a new project. Make sure you put in 'default folder'. Since it doesn't exist, eclipse will create this same folder again on your new computer. You must go to your old computer, find this folder, and copy-and-replace it onto your new computer.

Once you have copied this, you will know it worked if your eclipse is starting up in the manner you left it on your older computer. All of your windows will not display any code; it will say the 'resource could not be found'.

Now copy your project over. The directory structure must be /exactly/ the same. If you stored your project in users file, or something like that, with a different path name, this will not work.

One of my libraries was in my downloads folder, for example. Everything else was working correctly. I went to project-> build properties -> libraries tab clicked on the library (it was kryonet) then clicked edit. Note you will know if anything is missing because it will say missing in brackets beside it. Clicking edit will open a browse window, you must find the missing resource file and double click to add it to your build path.

If your project directory pathing has changed from one computer to the other, you will likely have to go into project properties and manually edit path (as described above) for each resource that has a new location.

But no, you do not have to import anything.




回答7:


Tested Solution:

  • Copy across the entire folder of your project to the new computer
  • In this new computer, launch Eclipse select the old workspace you copied accros above, or create one if you have not had it
  • Choose File -> Import... -> General -> Existing Projects into Workspace -> Next, then Browse to the root of the project/folder, select it, click OK, then, if it's a valid Eclipse project, you should see it is being checked in (a list of projects, this wizard found. You can just check the one you are interested in or you can also include the demo projects - it is up to you). Click Finish and you're there.

source: https://www.eclipse.org/forums/index.php/t/248863/



来源:https://stackoverflow.com/questions/15227903/how-to-transfer-project-written-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!