What i already have:
Using eclipse keppler i am creating an eclipse plugin that is to work under linux, windows and mac. I am trying to wrap some existing java code into this eclipse plugin. This works fine. The execution of the wrapped code can be started by clicking a button in the plugin ui. The wrapped code uses some environment variables. When these are set as environment variables and eclipse is then started the variables are found and used.
What i would like to do:
I would like to set the required environment variables in some textfields in the plugin ui and then start the execution of the wrapped code which should then use the variables form the textfields, so that i no longer need to set them as environment variables before starting eclipse. This would obviously be more flexible. This feature is used by the eclipse ide itself when starting a run/debug-process. For these processes the environment variables can be set. This is the mechanism i would like to use.
My questions:
- How is it possible to start a process from an eclipse plugin and provide it with a set environment variables that are set in the plugin ui?
- Is it necessary to use ProcessBuilder or Runtime.exec() or is there some java-only solution?
- Is the only way to find an answer to search through the eclipse souce code?