Search code examples
eclipsejavafxargumentsrun-configuration

Provision of relative VM arguments to JavaFX run configs in eclipse


A little background:

I want to learn JavaFX, I use eclipse ad my IDE, and I usually work on 2 PCs though a pen drive. I have added JavaFX libraries to the JavaFX project, but when I run the program, it is unable to run as VM arguments arent passed in.


The Problem:

I inserted the following VM arguments in the run configuration: --module-path "G:\<Path to lib folder>\Prerequisites\JavaFX\lib" --add-modules javafx.controls,javafx.fxml It all runs well and fine, but when I try to run the same thing on the other PC, I need to change the args to --module-path "E:\<Path to lib folder>\Prerequisites\JavaFX\lib" --add-modules javafx.controls,javafx.fxml. my the lib folder is present in my workspace itself. So is there any way to make it relative and not change it every time?


Any help will be greatly appreciated! Thank you in advance.


Solution

  • There are many Variables you can use in the VM arguments (and elsewhere). Click the 'Variables' button at the bottom right of the VM arguments field to see the list.

    You probably want

    ${workspace_loc:/project/path in project}