How to build an executable file from a maven gluonfx project [PARTIALLY SOLVED]

I was not able to build an executable file from a maven/gluonfx project, but i partially solved opening x64 Native tools, using cd command to move into the gluonfx project folder and i used the

mvn gluonfx:build command to build the app. So everything works but, no fxml is loaded, just like this:

enter image description here

but if i use mvn gluonfx:run command into intellij,everything works, like this:

enter image description here

So if i try to use mvn gluonfx:nativerun command into x64 Native tools program, it gives me this error:

enter image description here

So probably there is a problem loading the FXML. If i try to run the app, using the mvn gluonfx:run command into the x64 Native tools program it still works. So i think that the problem is related with native run, and it has a problem loading the fxml in this configuration.

This is my pom file:

 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="" xmlns:xsi="" xsi:schemaLocation=" "> <modelVersion>4.0.0</modelVersion> <groupId>com.knnapplication</groupId> <artifactId>knn-application</artifactId> <version>1.0</version> <packaging>jar</packaging> <name>KNN-Application</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.release>11</maven.compiler.release> <javafx.version>19</javafx.version> <attach.version>4.0.16</attach.version> <gluonfx.plugin.version>1.0.15</gluonfx.plugin.version> <javafx.plugin.version>0.0.8</javafx.plugin.version> <mainClassName>com.knnapplication.KNNApplication</mainClassName> </properties> <dependencies> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-controls</artifactId> <version>${javafx.version}</version> </dependency> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-fxml</artifactId> <version>${javafx.version}</version> </dependency> <dependency> <groupId>com.gluonhq</groupId> <artifactId>charm-glisten</artifactId> <version>6.1.1</version> </dependency> <dependency> <groupId>com.gluonhq.attach</groupId> <artifactId>display</artifactId> <version>${attach.version}</version> </dependency> <dependency> <groupId>com.gluonhq.attach</groupId> <artifactId>lifecycle</artifactId> <version>${attach.version}</version> </dependency> <dependency> <groupId>com.gluonhq.attach</groupId> <artifactId>statusbar</artifactId> <version>${attach.version}</version> </dependency> <dependency> <groupId>com.gluonhq.attach</groupId> <artifactId>storage</artifactId> <version>${attach.version}</version> </dependency> <dependency> <groupId>com.gluonhq.attach</groupId> <artifactId>util</artifactId> <version>${attach.version}</version> </dependency> </dependencies> <repositories> <repository> <id>Gluon</id> <url> </repository> </repositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> </plugin> <plugin> <groupId>org.openjfx</groupId> <artifactId>javafx-maven-plugin</artifactId> <version>${javafx.plugin.version}</version> <configuration> <mainClass>${mainClassName}</mainClass> </configuration> </plugin> <plugin> <groupId>com.gluonhq</groupId> <artifactId>gluonfx-maven-plugin</artifactId> <version>${gluonfx.plugin.version}</version> <configuration> <target>${gluonfx.target}</target> <attachList> <list>display</list> <list>lifecycle</list> <list>statusbar</list> <list>storage</list> </attachList> <reflectionList> <list>com.knnapplication.views.PrimaryPresenter</list> <list>com.knnapplication.views.SecondaryPresenter</list> </reflectionList> <mainClass>${mainClassName}</mainClass> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>ios</id> <properties> <gluonfx.target>ios</gluonfx.target> </properties> </profile> <profile> <id>android</id> <properties> <gluonfx.target>android</gluonfx.target> </properties> </profile> </profiles> </project> 

EXCEPTION:

[dom nov 13 20:38:42 CET 2022][INFO] [SUB] nov 13, 2022 8:38:42 PM com.sun.javafx.application.PlatformImpl startup [dom nov 13 20:38:42 CET 2022][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6e8dacdf' [dom nov 13 20:38:42 CET 2022][INFO] [SUB] nov 13, 2022 8:38:42 PM com.gluonhq.attach.util.Platform <clinit> [dom nov 13 20:38:42 CET 2022][INFO] [SUB] INFO: [Gluon Attach] System Property javafx.platform is not defined. Platform will be set to Platform.DESKTOP [dom nov 13 20:38:42 CET 2022][INFO] [SUB] IOException: javafx.fxml.LoadException: [dom nov 13 20:38:42 CET 2022][INFO] [SUB] /com/knnapplication/views/primary.fxml:37 [dom nov 13 20:38:42 CET 2022][INFO] [SUB] 

LINE 37 of PRIMARY FXML

enter image description here

17

Related questions 4 How to build a runnable JavaFX application using maven? 2 How to create executable jar using maven for Javafx Application with its dependent jars? 0 How to construct an executable jar with JavaFX dependencies? Related questions 4 How to build a runnable JavaFX application using maven? 2 How to create executable jar using maven for Javafx Application with its dependent jars? 0 How to construct an executable jar with JavaFX dependencies? 0 a method to build an executable JavaFX Jar from Maven Archetype 11 Build executable JAR with JavaFX11 from maven 3 How to generate executable jar in JavaFX with maven project 2 JavaFX + GraalVM + Gluon 6 Gluon client maven plugin for JavaFX on Windows fails to compile? 0 How To Build Java Native Executable Files For Linux 1 How to build a executable JavaFX 11 application Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like