Generating executable file in IntelliJ for Windows

18,435

Solution 1

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...

Solution 2

The best solution for this is using exe generator software. There is plenty of exe generators out there.

EXE4J is the most simple & easy tool to use.

In EXE4J,
You can upload your main jar file and select the main class.

I think this will be solved your problem.

Share:
18,435
Miguel Mesquita Alfaiate
Author by

Miguel Mesquita Alfaiate

ALFASOFT - Tailor Made IT Solutions Nearshoring, Consulting, Procurement, Software Development, System Integrations PHP, Laravel, Drupal, Wordpress, Prestashop, Magento C#, Umbraco, ASP.NET MVC Java, Android, Xamarin, Outsystems, NativeScript C++, Python, Node.JS

Updated on June 16, 2022

Comments

  • Miguel Mesquita Alfaiate
    Miguel Mesquita Alfaiate about 2 years

    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
    Miguel Mesquita Alfaiate over 5 years
    I know there are other solutions. I would prefer sticking with IntelliJ, as it has been working so far. I am asking for a resolution to the IntelliJ problem, not an alternative. Thank you anyway.