3

How to make my JavaFx project executable (also from machine without sdk installed)? I'm doing it in Intellij. This is how does my structure of project file look like:

Arcade_game
           |
           |--.idea
           |--out
                 |--production
                              |--...
           |--src
                 |--(many .java files)
                 |--images (containing images used in my project)
                 |--audio (containing mp3 files used in my project)
                 |--txts (containing txt files used in my project)

The way I tried to make a .jar from my project was through File > Project Structure > Creating an artifact > Jar > From module with dependencies > with a selected main class. The output folder I set was out file mentioned above. When I built this artifact, jar file appeared in my out folder, making it possible to launch it, however, not all dependencies included. Everything except audio (so as soon as a part of my project with audio started, it crashed). Is there some way, how to make sure ALL dependencies are correctly transfered? Or is there some better way I should do this overall (let's say use different folder for an output...)?

enneenne
  • 209
  • 1
  • 8
  • This might be due to your way of accessing the files. Using `absolute path` instead of `relative path` could work. – Onur Arı Jun 27 '20 at 19:47
  • I suggest using Maven. Not only will it include all your dependencies, but it can also help you package your java project into an executable file. Something like this -https://www.youtube.com/watch?v=yG8YCLYccVo(first part of a two-part video) – Steven Oh Jun 28 '20 at 06:25
  • 1
    Does this answer your question? [What is the best way to deploy JavaFX application, create JAR and self-contained applications and native installers](https://stackoverflow.com/questions/30145772/what-is-the-best-way-to-deploy-javafx-application-create-jar-and-self-contained) – Tanuj Jun 28 '20 at 06:36

0 Answers0