0

I have created an Eclipse4 RCP application and I would like to be able to launch multiple instances. By default when a second RCP instance is launched it says "The workspace is already in use". I know that it is possible to use options so that the application runs with no workspace but in my case I still wont to preserve the layout of the application. So is there a way to avoid workspace lock or to manually save the application state somewhere?

Thanks

Dmitry
  • 2,033
  • 1
  • 22
  • 31

1 Answers1

0

Only one instance can use a workspace at a time so you would need to use different workspaces for each instance.

It is possible to set the workspace location during startup. The @PostContextCreate of your LifeCycle class is a suitable place to do this.

Use something like:

Location instanceLoc = Platform.getInstanceLocation();

instanceLoc.set(URL of workspace location, false);
greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Thanks. This solves the problem only partially. It would not be possible to save the layout for the next time the application is launched. I think it is possible to copy the workspace of the closing instance to some location and then create the workspace for a new instance by copying it again in to a temporary location. But it could be a source of bugs. – Dmitry Apr 08 '16 at 14:53