-2

Possible Duplicate:
How can I convert a JAR file to an EXE file?

Sorry if I sound like a newbie... But I am very new to the Java coding stuff.

Is there any way that you can convert an exe file to an executable JAR file? Like with Minecraft, there are a few versions of the launcher, some being JARs and some being EXEs. Please tell me if there is any way to run exes as JAR files, for example, the exe of GTA III or etc.

Community
  • 1
  • 1
  • 2
    That makes no sense whatsoever. What would it mean? – SLaks May 31 '12 at 11:54
  • 1
    @Christoffer I think he's talking about the reverse operation; he _doesn't_ want to use the bound JVM. That said, except in very rare circumstances there _is no Java code in there at all_; extracting a JAR is on the nonsensical side of impossible. – Donal Fellows Jun 01 '12 at 14:03

1 Answers1

0

Files with a .exe extension simply imply that the file is an executable image, usually conforming to the Portable Executable standard. They consist of compiled code, native to the operating system and processor, in the form of assembly instructions that the processor can interpret. They may be originally written in almost any language - C, C#, C++, VB6, VB.NET, Delphi, x86 asm, Java, etc. For all intents and purposes (excluding .NET), you can't turn these into the original code.

JAR files are special archives containing compiled Java objects. These work in a similar way to executables, except they're handled by the Java Virtual Machine (JVM) rather than the operating system itself.

There's no way to turn compiled native code from an executable into a JAR. They're completely different concepts.

Polynomial
  • 27,674
  • 12
  • 80
  • 107
  • It's not quite true; if the executable is just a binding of a JVM to a JAR then it could be possible to separate the two. That's a tiny minority of executables though (and almost certainly not GTA3!) – Donal Fellows Jun 01 '12 at 14:07
  • @DonalFellows True, but extracting the JAR from the EXE isn't something you can do easily. It'd involve a PE analyser and some dissection. – Polynomial Jun 01 '12 at 15:50