Compile jar for exe and do not need after having an JRE

4

One more problem here, and I need your help. I downloaded a program that converts jar files to exe. The only problem is that I still need the JRE. Is there any way to convert the program to exe and then do not need the JRE (or the JRE to go inside the exe)?

Explaining: I want to convert from jar to exe and then do not need the JRE (or it gets embedded in the program)

    
asked by anonymous 26.08.2014 / 04:25

2 answers

4

There are some (commercial) tools that convert a JAR to an executable, such as Excelsior or JexePack , which can do what you want. Another alternative is to create an installation program that, in addition to installing your program, also install the JRE if necessary. install4j is one such tool. Finally, as suggested by @Eduardobrj, you can also distribute the JRE (both your classes and java.exe) along with your application (according to this thread in java.com .

    
26.08.2014 / 04:45
2

Once dependent on the JVM forever dependent on it. So, as for the issue of not needing the JRE, the simplistic answer is ... impossible, because the code is based on functionality and JAVA code that the application uses.

That said ... some solutions are possible that can compress the JAR (s) inside an EXE, but include the JRE inside I do not know.

However, in response ... the best solution is with the GCJ compiler.

GCJ can compile the Java source code for Java bytecode (class files) or directly into native machine code, and Java bytecode for native machine code.

In this sense, this will be the solution to the question asked, but, "everything has a but", this solution poses some problems in the medium term with regard to compatibility and maintenance during the life of application since we can not rely on the that JAVA has the best in my opinion. The abstraction of the operating system and especially all the support implicit in the JAVA tools.

    
26.08.2014 / 16:44