0

I have had Intellij IDEA generate an executable jar for me and executing the jar using java -jar command works great.

But when I try to wrap this jar into an exe file using launch4j, various errors happen. First there was an error saying "Could not find or load main class".

After looking at this and this questions I thought the problem is about pathnames or classnames. However, that was not the case. Apparently, the main class was found, but couldn't be loaded because there was no pathnames to Java and JavaFX runtimes.

After adding rt.jar and jfxrt.jar to classpaths another error appeared:

"JavaFX runtime components are missing, and are required to run this application"

And now I really don't know what to do. I downloaded the latest jre (8.0.221) but nothing changed. jfxrt.jar is a JavaFX runtime to my knowledge, but it seems like the application doesn't recognize it as one.

Any recommendations for deploying, suggestions for my project or remarks are welcome and appreciated. Thanks!

2 Answers2

1

I achieved what I wanted by using one of launch4j built-in functions. In section JRE there is an option for bundled jre path. And to create native app launcher with bundled jre you just have to specify the path of jre. This took me 5 days to find.

-1

You can make .exe file using Inno tool set up. I have used this there was no error, exe runs fine. Link :- http://www.jrsoftware.org/ishelp/

Sunil
  • 54
  • 4