can java produce .exe? if it can produce jar,how do you do?

A

aungkopyay

i am a beginner of studying in program.so i have many question.if you
know that,i would like to know.
 
M

Manish Pandit

Java compiler cannot generate exes. However, you may be able to find
third party tools that can convert java bytecode to native binaries.

Executable jar files are not native binaries, but they are packaged
with a class declared as main-class in the manifest. Running java -jar
followed by the jar file name will pick up the main-class, and execute
it in the JVM.

You can google the above points for more information - I think they are
fairly common questions.

-cheers,
Manish
 
T

Thomas Kellerer

Manish Pandit wrote on 26.10.2006 21:05:
Java compiler cannot generate exes. However, you may be able to find
third party tools that can convert java bytecode to native binaries.

Executable jar files are not native binaries, but they are packaged
with a class declared as main-class in the manifest. Running java -jar
followed by the jar file name will pick up the main-class, and execute
it in the JVM.

You can google the above points for more information - I think they are
fairly common questions.
For executable jars, there is always the SDK documentation as well...
 
D

David Lee Lambert

i am a beginner of studying in program.so i have many question.if you
know that,i would like to know.

The "gcj" (GNU Compiler Collection - Java) compiler can produce the
executable format of the platform it is run on; so the gcj from cygwin or
mingw32 will produce a Windows .EXE file.

Mono includes tools (IKVM, IKVMC) that can be used to compile Java source
code or classes into CLR excutable files (also .EXE ending).

Visual J# seems to support Java 1.3 syntax and libraries, although it's
not officially Java compatible. It will also produce .NET ".exe" files.

With the Sun java tools, you could create a small wrapper that loads your
main class with JNI, following the example of "launcher/java.c" in the
source-archive that comes with the JDK (src.zip). You would have to
compile it with a C or C++ compiler.

However, if you are a beginner, you probably ought to just work on
programs that are run with the "java" command until you gain more
experience.
 
L

Luc The Perverse

David Lee Lambert said:
The "gcj" (GNU Compiler Collection - Java) compiler can produce the
executable format of the platform it is run on; so the gcj from cygwin or
mingw32 will produce a Windows .EXE file.

Mono includes tools (IKVM, IKVMC) that can be used to compile Java source
code or classes into CLR excutable files (also .EXE ending).

Visual J# seems to support Java 1.3 syntax and libraries, although it's
not officially Java compatible. It will also produce .NET ".exe" files.

With the Sun java tools, you could create a small wrapper that loads your
main class with JNI, following the example of "launcher/java.c" in the
source-archive that comes with the JDK (src.zip). You would have to
compile it with a C or C++ compiler.

However, if you are a beginner, you probably ought to just work on
programs that are run with the "java" command until you gain more
experience.

You forgot about excelsior
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top