2

How to make eclipse refer to workspace in the same folder as eclipse.exe file without asking me every time. I use eclipse on usb stick on several computers (different labs around campus + my own laptop), and drive letter always changes, so is there a way to make eclipse... more portable?

1 Answers1

1

See this answer about starting Eclipse with a specific workspace

There is a command-line argument -data you can give Eclipse for the location of the workspace. You could create a batch file called 'runeclipse.bat' and give it the current directory as the location of the workspace. I would create a subdirectory named 'workspace' though.

eclipse.exe -data .\workspace

A better idea would be to edit the eclipse.ini, which is in the same directory as the executable, and put the -data argument there. Make sure the -data argument appears before any JVM arguments

For example, here is my eclipse.ini file

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m

I would add the -data argument like so, I've left empty lines to show what was added since there is no HTML or Markdown formatting in a code block, remember that the blank lines should not be in the actual eclipse.ini file.

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile

-data
.\workspace     

-vmargs
-Xms40m
-Xmx384m
Community
  • 1
  • 1
Kelly S. French
  • 12,198
  • 10
  • 63
  • 93
  • editing eclipse.ini sounds like an interesting idea, but can you specify how to do that, please? and I do use a sub-directory "workplace". – user3361060 Feb 27 '14 at 22:36
  • Thanks a lot. Turns out if you add -data .\workspace in one line, it makes no changes. – user3361060 Mar 01 '14 at 23:07