如何将Eclipse工作区和项目从Windows转移到Linux和Mac [英] How to transfer Eclipse workspace and project from Windows to Linux and Mac

查看:526
本文介绍了如何将Eclipse工作区和项目从Windows转移到Linux和Mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在Windows开发的产品多年。该产品由一个Eclipse工作区和约20个项目组成。
在Windows上,我们要求每个开发人员将项目签到d:\dev\product文件夹,并将统一的Workspace复制到d:\dev\prod_workspace。这样,每当设置新机器时,我们只需将文件复制到同一个文件夹,我们就可以立即开始工作。



现在我们需要将开发环境移到Linux和Mac。但在Unix上没有D:\。而Linux的home文件夹主要是/ home / username和/ Users / username for Mac。我们发现在引用项目时,Eclipse在工作空间中保持绝对路径,因此简单地复制工作区将不再工作。即使我们在Linux机器上手动创建/配置工作区,仍然无法将其复制到另一个用户,因为绝对路径已更改。



我猜我们的目标是以容易地设置开发环境。你有什么建议来移动eclipse工作区吗?

解决方案

我已将我的eclipse项目从windows xp移植到RHEL Mac)



您的任务可以通过以下步骤完成: -


  1. 在项目代码中使用工作空间变量,而不是绝对路径。

  2. 将工作区移动到linux中的某个位置作为/ Workspace,或者如果要保持用户特定的工作空间文件夹为/ home / user_name / Workspace。

  3. 有一个选项可以将所有Windows的\更改为/在Linux中。该选项可以在eclipse中的文件菜单下找到。

  4. 更改在哪里找到classpath目录的设置,可以通过在项目查看器面板中右键单击项目菜单找到选项。

  5. 有一个选项可以从头开始构建项目。您只需点击该选项,eclipse将重新编译该项目。

一旦这一切完成,并且所有的数据库连接已成功移植到linux中,您将有一个在linux上运行的工作项目。


We have a a product developed on Windows for years. The product is composed of one Eclipse workspace and about 20 projects. On Windows, we ask every developer check out projects into d:\dev\product folder, and copy a unified Workspace to d:\dev\prod_workspace. This way, whenever a new machine is set, we simply copy files to the same folder, and we can start working immediately.

Now we need to move our development environment to Linux and Mac. But there's no D:\ on Unix. And home folder for Linux is mostly like /home/username and /Users/username for Mac. We found Eclipse keeps absolute path in workspace when referring to projects, so simply copy workspace over does not work anymore. Even when we manually create/configure workspace on a Linux machine, it still cannot be copied over to another user, because the absolute path is changed.

I guess our goal is to allow easy setup of development environment. Do you have any suggestion to move eclipse workspace around?

解决方案

I have ported my eclipse project from windows xp to RHEL(never tried Mac)

Your task can be accomplished in the following steps :-

  1. Use workspace variables in your project code rather than absolute path.
  2. Shift your workspace to some location in linux as /Workspace or if you want to keep it user specific make the workspace folder as /home/user_name/Workspace.
  3. There is an option to change all the \ of windows to / in linux. The option can be found under the file menu in eclipse.
  4. Change the settings of where to find classpath directories, the options can be found by just right clicking on the project menu in the project viewer panel.
  5. There is an option to build the project clean from scratch. You just have to click on the option and eclipse would re-compile the project.

Once all this is done, and all your database connections have been successfully ported to linux, you would have a working project running in linux as well.

这篇关于如何将Eclipse工作区和项目从Windows转移到Linux和Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆