0

I am having problem with creating an executable JAR file where i can double click an icon and make my program start. I've made a fun little app for my friend for him to try this Xmas, but i've spent way too many hours trying to make this work.

When i try to execute the jar file, i get a ClassNotFoundException and i cannot for the life of me figure it out. I am using Intellij and believe the fault is under file>projet structure>artifacts>JavaFX and under application class. What is supposed to be there? i tried class path to the main class

  • Have you checked if your issue is this ?https://stackoverflow.com/questions/22870361/classnotfoundexception-when-running-executable-jar – RBz Dec 24 '19 at 10:18
  • Yes i have searched stack overflow for a day, and the answers i got i didn't understand. I would love to set the filepath through intellij – Brage Rochman Fridriksson Dec 24 '19 at 10:31

1 Answers1

0

If you are using maven or gradle to build your application, the simplest thing you can do to make a self sufficient, runnable jar is, to create a fatjar (or uber jar). A fatjar is nothing but a jar containing your classes along with the dependencies.

Refer answer below for maven based project : How can I create an executable JAR with dependencies using Maven?

Or for gradle based project : How do I create an executable fat jar with Gradle with implementation dependencies