2

I've been struggling with this for the past few hours, and I can't seem to find a way to export this properly.

Error: Could not find or load main class me.mrbakbuki.app.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

Relevant part from my pom.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>8.8.3</version>
            <configuration>
                <mainClass>gui.Main</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>me.mrbakbuki.app.Main</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
        </plugin>
    </plugins>
</build>

I want to export this as an executable jar file Any help appreciated

MrBakbuki
  • 71
  • 4
  • You need to add a classifier for the OS. – dan1st Jun 17 '21 at 16:10
  • Does this answer your question? [Build executable JAR with JavaFX11 from maven](https://stackoverflow.com/questions/57019143/build-executable-jar-with-javafx11-from-maven) – Andrey Jun 18 '21 at 07:28

1 Answers1

-1

You need to run your jar with Java 8 because it comes with JavaFX. I had the same problem a while ago and running the jar with Java 8 solved it for me.

Dragxfly
  • 1
  • 1
  • 1