I had created a Java Swing Application, I want to run my applications, in all System, Suppose if a System, does not have JRE, then i have to install JRE using Installer in program without aware of the user knowledgeable that the JRE is installed.
-
possible duplicate of [Java to native code](http://stackoverflow.com/questions/2991799/java-to-native-code) – Bombe Mar 21 '11 at 14:27
-
@Bombe: no it's not duplicate, i have a doubt whether going for native will help me or not – Sankar Ganesh PMP Mar 21 '11 at 14:29
4 Answers
There were a few projects for doing this, but from what I can see they all fizzled out - bottom line seems to be that you need a JRE - especially for swing

- 7,682
- 5
- 22
- 30
-
1
-
My desire is i have to run my exe in all system irrespective of JRE presence – Sankar Ganesh PMP Mar 21 '11 at 14:29
-
I can say from experience that deployment issues have always been the thorn in the side of the java client app developer. Since you wish to compile to a windows exe, maybe java (In its current state) is not the best tool for the job? I know it is probably a bit late but would a HTML app / C# suit you better? – tofarr Mar 21 '11 at 14:42
The best solution is not to try and install anything silently, but instead to assist the user to install Java. Oracle's deployJava.js was designed to do just that, before embedding applets or launching Java Web Start applications.
While on the subject of JWS, it is also a good choice for installing/running & updating Java rich client (e.g. Swing) apps. on platforms that support Java.

- 1
- 1

- 168,117
- 40
- 217
- 433
You can generate an EXE out of your Java source but you will still need the JVM to run it on the destination System. So its not real native.

- 36,908
- 70
- 97
- 130
-
if you have a JVM,,, you should also have a JRE, no? I know they are not requisite of each other, but really.. – apesa Mar 21 '11 at 14:31
-
@apesa: The Java Runtime Environment (JRE) is an implementation of the JVM (Java Virtual Machine). – CloudyMarble Mar 21 '11 at 14:38
There is no workaround for running non native class files reliably or really at all without the JRE.

- 12,163
- 6
- 38
- 43