Suppose I wrote a GUI using swing or JavaFX. Then I collect something like Maven and get a jar. And then what?

  • How to make the user to run my application as an exe file without installing jre?
  • Is this even possible?
  • I remember I saw it in some program that was made so that jre is stored in the folder with the installed program and started when the exe file is launched. Is it hard to do?
  • one
    Use the Launch4j tool. Read tyts - Vladimir Glinskikh

2 answers 2

There is a program called Launch 4J. Using it, you can create an EXE file from a JAR file, even by giving it your own icon.

Note. If you work in the Eclipse programming environment, you need to compile the project not in the JAR file , but in the Runnable JAR file .

  • Suppose I made an EXE file using Launch 4J. Can I run it after this without jre? - faoxis
  • It must be yes. Try it. Javadoc does not say this. It is only necessary that the desirable version of Jav'y coincided. - nick

Perhaps, we google java to exe, it’s not hard to do, the exe file calls java.exe and “bites” it to the jar file as on the command line, but weighs a lot if you drag jre with you and, most importantly, why write for Windows Java applications, it is very bad for this.

  • I wrote above that I am doing a GUI in Java. There may not be enough time to learn other languages. By the way, I do not agree that Java is not suitable for windows. Many programs that I run on windows are written in Java. For example, IntelliJ Idea, Keil uVision, CooCox and many others. Moreover, the last two examples are not ported to Linux (which is sad, of course). - faoxis
  • @faoxis So you have not seen any other languages ​​at all, but you have an opinion that Java is well suited for Windows? Oh well. - user204455