How To Use A Relative Path For The Eclipse Workspace

拜拜、爱过 提交于 2020-01-14 04:23:22

问题


Whenever I move the Eclipse folder to another location, it would completely reset unless I switch the workspace manually. It seems to use an absolute path, but I want a relative one to actually make it fully portable.

Any way of doing this? Where do I find the workspace path I've set?

As a side note, referenced libraries inside projects must use relative paths to prevent a re-configuration.


回答1:


If your workspace is relative to your eclipse folder then try adding this to the config.ini using relative path with platform schema to workaround the fact that you cannot use an absolute path according to this.

-data platform:/base/workspace

The file is located in the root eclipse folder.




回答2:


if you are working on Windows create a bat file within this command subst G: ,G is a local disque name it's just an example the only condition it to choose a disque local name that not already exist. put this bat file next to your workspace in the same level, then execute this but file ,a disque local icon with the name G or the one you had chosen will appear in your work station,then launch eclipse and chose the this path G:\workspace.the positive about this method is not only eclipse became portable but everything exist in same level of the bat file.



来源:https://stackoverflow.com/questions/23867762/how-to-use-a-relative-path-for-the-eclipse-workspace

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