0

I want to set up workspace location for an Eclipse instance in order to distribute it to some of my friend. I must use relative path to workspace for this. So far I decided to use data switch to point particular workspace located inside the Eclipse directory. The problem is when I use command-line switch like this:

./eclipse -data workspace

it works fine, but when I try to add this at the end of eclipse.ini like this

-data
workspace

it does not seem to have any effect. Note that I've tried to restart Eclipse with clean switch after editing eclipse.ini.

I noticed that setting osgi.instance.area in eclipse/configuration/config.ini let me point to workspace but I couldn't get relative (to elcipse directory) path working. I tried a number of solutions (@user.dir/workspace, platform\:/base/workspace and just workspace), all they actually compute relative path from user home directory (and platform solution creates directory named platform in user's home).

The desired behaviour is implemented in Scala IDE, but I can't figure out how they get this.

Artem Pelenitsyn
  • 2,508
  • 22
  • 38
  • If the `eclipse.ini` contains a `-vmargs` entry then everything in file after that is treated as a vmarg **not** an Eclipse argument. So put the `-data` at the start of the file. – greg-449 Jul 02 '14 at 06:58
  • @greg-449 ah, it works, so please convert your comment to answer. But this again does not allow to use path relative to elipse directory: relative path is computed from user home directory. Guess I'll have to open new question. – Artem Pelenitsyn Jul 02 '14 at 07:25

1 Answers1

1

When add to the eclipse.ini file check if there is a -vmargs entry in the file. Everything in the file after any -vmargs is treated as a VM argument not an Eclipse argument.

So add the -data at the start of the file.

greg-449
  • 109,219
  • 232
  • 102
  • 145