1

I would like to merge Java Virtual Machine and my .java code (or compiled .class files) into a single executable binary. How can I do this?

Raedwald
  • 46,613
  • 43
  • 151
  • 237
Jakub M.
  • 32,471
  • 48
  • 110
  • 179
  • Possible duplicate of http://stackoverflow.com/questions/2991799/java-to-native-code – Raedwald Jan 19 '11 at 13:25
  • @Raedwald Not really. @user be specific. jvm is not a java file. – jmj Jan 19 '11 at 13:27
  • While you can create a .exe file (usually not a good idea) it will use shared libraries so you won't end up with just one file. It is far simpler to specificy that anyone running a JAR has to have Java installed. – Peter Lawrey Jan 19 '11 at 13:28
  • Have in mind that I don't want to compile Java into a machine code - I just want to have everything in a single point-and-click file. Absolutely enough would be having the JVM "glued" with the code somehow, that when I run the file, it runs the JVM and the code – Jakub M. Jan 19 '11 at 14:41

2 Answers2

0

I really doubt you are allowed to do that from the licensing prospective. You are going to let end user use software without passing them through accepting JVM license.

BarsMonster
  • 6,483
  • 2
  • 34
  • 47
0

GCJ basically works like that, but depends on the GNU classpath libraries and is not fully compatible with the Java standard (may not support some language features and parts of the standard API).

Michael Borgwardt
  • 342,105
  • 78
  • 482
  • 720