Portable Eclipse

旧巷老猫 提交于 2019-11-28 23:45:42
RaYell

Have you tried using Eclipse Portable?

The only thing to keep in mind is that when switching the workspace, you need to remember to give it a relative path (like ../../Data/workspace).

You could use the dos command subst to get a consistent drive letter by creating a new virtual drive letter (say x:) that maps to your Eclipse folder on your usb drive, and then make all the config paths reference the drive x:

You could make a little batch file on the usb drive that you click on to create the drive x:

C:\>help subst
Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]
SUBST drive1: /D

  drive1:        Specifies a virtual drive to which you want to assign a path.
  [drive2:]path  Specifies a physical drive and path you want to assign to
                 a virtual drive.
  /D             Deletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.

You could also remap letter for your USB stick in Windows Disk Management (subitem in Computer management) to be smth like 'U:'. Once done, it will be re-assigned to same stick every time you plug it. Not very universal, since your user need rights to access this setting first time, but it could help in some different scenarios.

You can always use Ant to build your programs, with Ant you can have relative paths... Plus you can also use Ivy to track dependencies in Ant, I do that in every project that I have.

Another alternative is to manually edit your .classpath files to contain relative paths.

It is a bit of a hassle, though, as you'll have to manually update the files whenever Eclipse changes them.

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