简体   繁体   中英

How To Use A Relative Path For The Eclipse Workspace

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 .

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.

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.

On your eclipse.ini file, just above the line (it must be above this line)

-vmargs

Paste these lines exactly as follows (you may replace DesiredWorkspaceName )

-data
DesiredWorkspaceName

Do not create a directory beforehand. Eclipse will do this automatically. For things to go smoothly for the most part, you really should let Eclipse create the directory. It is imperative the -data is in a line all on its own.

Tested with Eclipse: product verison 4.17.0, 2020-09 R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM