Generating executable file in IntelliJ for Windows

Miguel Mesquita Alfaiate :

I used to work on an IntelliJ project that was started before I started working on it. This project had a configuration that allowed me to generate an EXE file that could easily be sent to windows users.

It would generate a massive EXE file bundled with all the needed JARs of the application, and upon running it the first time, it would silently "install" itself into the AppData folder, as if it were a regular windows setup file, even though the user would not even notice it doing that installation.

I am trying to configure a project in IntelliJ to do the exact same thing, but first I have not been able to output the exe file by selecting "exe" as the Java FX native bundle type. It just generates a .jnlp and .jar file. When I select "all", as per some other post here in stackoverflow, it generates an exe file, but only with a few kb in size, which does not contain any of the .jar files that should be part of it. Moreover, when I try to open it, it just crashes saying the main class was not found.

Am I missing some setting for building the project? I am using IntelliJ 2018.3.2

Here are some screenshots:

enter image description here

enter image description here

Miguel Mesquita Alfaiate :

I have been able to get past this error, after changing the verbosity of the compilation and going through the logs.

There was a log message which helped fixing this:

The process complained about the Inno Setup Compiler missing, which was right. Makes me wonder why IntelliJ would have that feature built in if it depends on external tools but does not notify the user clearly of this.

Detected [iscc.exe] version 0.0 but version 5.0 is required.

After going to the Inno Setup site, downloading and installing the tool, I was able to get the executable to be generated.

Now I am struggling with another error, which is the executable complaining about the main class referenced in the Artifact not being found, but at least I have moved past the first problem! Going to tackle this one now...

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=70402&siteId=1