Closed jamhour1g closed 2 months ago
Hi @jamhour1g! Please, could you try with v1.7.6?
@fvarrui I used version 1.7.6 to run the program, and it successfully built and created the installer without any exceptions. However, there was no output when I tried to run the .exe file. I initially thought it might be due to Kotlin and the plugins failing to find the main function, so I rewrote the Main class in Java to test it, but the results remained the same. Do you have any ideas why this might be happening?
@jamhour1g You can see what's happening just running your EXE this way:
cd target\MVTOrchestrator
jre\bin\java -jar MVTOrchestrator.exe
It probably says something like: Error: JavaFX runtime components are missing, and are required to run this application
If so, to fix this, you should specify JavaFX modules as VM arguments this way in JP config:
<vmArgs>
<vmArg>--add-modules=javafx.fxml,javafx.controls</vmArg>
</vmArgs>
I hope this helps! Please, let me know if you manage to run your EXE without problems.
@fvarrui Indeed, your assumption was accurate; the error message reads: "Error: JavaFX runtime components are missing, and are required to run this application." To address this, I tried adding the VM arguments to the configuration:
<vmArgs>
<vmArg>--add-modules=javafx.fxml,javafx.controls</vmArg>
</vmArgs>
Nevertheless, this approach failed to resolve the problem, which may be linked to the project's module-info file.
module MVTOrchestrator {
requires javafx.controls;
requires javafx.fxml;
requires kotlin.stdlib;
requires java.logging;
requires atlantafx.base;
requires kotlinx.coroutines.core;
requires kotlinx.coroutines.javafx;
requires java.prefs;
opens com.jamhour.ui.controllers to javafx.fxml, java.prefs;
exports com.jamhour.ui;
exports com.jamhour.util;
exports com.jamhour.ui.controllers;
exports com.jamhour.model;
exports com.jamhour.process_management;
}
Hi @jamhour1g! Did you manage to fix it? I have to say that JP doesn't support Java Modules at the moment. I'm so sorry, but this is a planned feature.
Sorry!!!!
I've just realized that you need another VM argument (--module-path=libs
), so your bundled JRE is able find the JavaFX modules:
<vmArgs>
<vmArg>--add-modules=javafx.fxml,javafx.controls</vmArg>
<vmArg>--module-path=libs</vmArg>
</vmArgs>
libs
folder is where JP stores all of your project's dependencies.
Hi @fvarrui, thank you for your assistance. Regarding your initial response, I wasn't able to resolve the issue, but I did run the application using a custom JRE created with jlink. I executed the JavaFX plugin's javafx:jlink
command beforehand and ran the ".exe" file with that JRE.
Regarding your previous response, I tried it once more and it was successful. Nonetheless, I've run into an issue where the file structure is missing a JRE image. As a result, it operates on my machine, but not on a virtual machine, due to the absence of a JRE within the app/vm.
JavaPackager configuration
<configuration>
<mainClass>${kotlin.MainClass}</mainClass>
<customizedJre>true</customizedJre>
<generateInstaller>true</generateInstaller>
<administratorRequired>true</administratorRequired>
<platform>auto</platform>
<vmArgs>
<vmArg>--add-modules=javafx.fxml,javafx.controls</vmArg>
<vmArg>--module-path=libs</vmArg>
</vmArgs>
</configuration>
bundleJre=true
property is missing in JP config
@fvarrui, thank you so much for your assistance; everything is functioning excellently now ❤️
I'm submitting a…
Short description of the issue/suggestion: I ran the Maven package and encountered an "org.codehaus.plexus.util.cli.CommandLineException" error. After tracing the cause, I found that the "light -spdb -out" command failed to execute with the following error:
Also, another error is not related to the exception but might be the cause of it.
And there's a deprecation warning
Steps to reproduce the issue/enhancement:
What is the expected behavior? To package the app, provide an installer, and run it correctly.
What is the current behavior? The installer is provided, but when run, it doesn't work.
Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?
Please tell us about your environment:
Other information (e.g. related issues, suggestions how to fix, links for us to have context)
the project is available on my GitHub page under the name "MVTOrchestrator". The only change made was in the pom.xml. Here's the one I was testing with.