1

Possible Duplicate:
How can I convert my Java program to an .exe file?

Is it possible to run a jar file in a PC without installing JDK or JRE SDK? Converting to exe or any other way?

Community
  • 1
  • 1
Tushar Monirul
  • 4,944
  • 9
  • 39
  • 49
  • 1
    Sure. Just install the JRE. – SLaks Nov 27 '12 at 20:06
  • Yes, it's possible. Package a JRE within your app's root directory and using tools mentioned in the link provided by @assylias to generate a exe. – Cole Nov 27 '12 at 20:16
  • This is not a duplicate, voting to reopen. Converting jar file to an exe won't change the fact that it still needs java runtime environment to run. Any .exe would still need JRE to be installed. – eis Apr 13 '18 at 11:16

3 Answers3

5

Run jar file in .Net => http://www.ikvm.net/ (Another VM for java)
Or you can convert java to exe Using: http://www.duckware.com/jexepack/index.html
by the way you can use gcc.gnu.org/java ("GCJ" another compiler of Gcc Gnu) to compile java in standalone executable file

Omid Mafakher
  • 1,389
  • 1
  • 16
  • 40
  • 1
    jexepack would still need a JRE in the target computer, right? and any VM for java would still be a java runtime environment, if it were to run java apps. Including ikvm. but granted, JRE is Oracles terminology. – eis Nov 27 '12 at 20:16
  • no idea. i never make it standalone. – Omid Mafakher Nov 27 '12 at 20:29
  • [IKVM](http://www.ikvm.net/) provides a JVM and an implementation of the Java class libraries. In other words, it's a JRE. – DNA Nov 27 '12 at 20:39
  • by the way you can use http://gcc.gnu.org/java/ ("GCJ" another compiler of Gcc Gnu) to compile java in standalone executable file – Omid Mafakher Nov 27 '12 at 20:57
2

A jar file is a java archieve. A JRE is runtime environment for such a file, which it depends on. Without any kind of java runtime environment, you cannot.

However though, there are lot of environments that already have it, so you don't necessarily have to separately install it.

JDK/SDK is not needed.

Note that converting jar file to an exe won't change the fact that it still needs java runtime environment to run.

eis
  • 51,991
  • 13
  • 150
  • 199
2

You don't need an "JDK" or "JRE SDK" but you will need a "JRE" minimum. You can convert it to an EXE but you still need to inlcude libraries which have all the same information that a JRE would.

E.g. With a VC++ you need the runtime library for that version to run such a program.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130