Search code examples
javafxjvmrelative-pathjvm-argumentslaunch4j

Changing path in JVM options Launch4j isn't working


for some reason when i use the full path for the sdk lib the application runs.. --module-path="D:\tools\javafx-sdk-18.0.1\lib" --add-modules=javafx.controls,javafx.fxml,javafx.media but since i want the application to run on other computers, i copied the lib file which contains javafx.media...etc to the application folder and tried to put the path to it as "lib".. since it's in the same folder of the exe. but it didn't work.. i tried then to put the full path for the lib which is in the application folder and still it didn't work even tho I provided the whole path.. but when I reput the path "D:\tools\javafx-sdk-18.0.1\lib" it works again.. it feels like my application don't love other paths, he only works with this :( what should i do ?


Solution

  • I solved this problem.. first i needed to copy the whole folder of javafx18.0..etc not only the lib folder...2ndly when writting the path in Launch4j you must write it like this "../yoururl/" to make the path relative to the app folder... 3rdly i copied all my code and files to NetBeans in Maven project and build it using jlink...i created the runnable jar using eclipse and i converted the jar to exe then put it in the output folder of jlink build including the javafx18..etc and it worked fine now my app works on all computers...thanks to Slaw who commented. i figured jlink by his help.