Friday, 22 January 2016

[RCP] How to set workspace location in Eclipse RCP (이클립스 RCP Workspace 설정)

Eclipse Framework은 Workspace location에 Framework에 필요한 다양한 정보들은 저장 및 로드한다. Eclipse RCP에서는 workspace location을 명시적으로 설정을 하지 않을 경우, User Directoryprogram 내에서 설정하기 위해서는
소스에서

In my Eclipse / RCP application the .metadata directory was always created in the working directory. This worked fine when I was opening the application normally.

However, I needed file associations, so the user can just double click on file somewhere on his computer and open the file.

If you do this, the working directory is set to the directory where the file is located. This resulted in the creation of a .metadata directy at the same location. Brrr...

Since I dont like the creation of .metadata in the working directory either, because thats usually the application folder and not writeable, this needed to be addressed anyway.

So I looked for a solution to change the workspace location for the application.

To achieve this, two steps are neccessary. First we add an additional parameter in the Run configuration:

The paramater is -data @noDefault and makes it possible for us to set up our own location.

Which we do in the *Application class of our application:



No comments:

Post a Comment