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

Discussion in 'Java' started by aungkopyay@gmail.com, Oct 26, 2006.

  1. Guest

    i am a beginner of studying in program.so i have many question.if you
    know that,i would like to know.
    , Oct 26, 2006
    #1
    1. Advertising

  2. 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
    Manish Pandit, Oct 26, 2006
    #2
    1. Advertising

  3. 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...
    Thomas Kellerer, Oct 26, 2006
    #3
  4. wrote:
    > i am a beginner of studying in program.so i have many question.if you
    > know that,i would like to know.


    Enjoy: http://www.regexlab.com/en/jar2exe/

    But, the .exe doesn't perform as well as the .jar's do. And besides,
    jars are executable anyways...

    God Bless,

    shree
    Codedigestion, Oct 26, 2006
    #4
  5. On Thu, 26 Oct 2006 11:49:17 -0700, aungkopyay wrote:

    > 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.

    --
    PGP key posted on website ... http://www.lmert.com/people/davidl/
    David Lee Lambert, Oct 27, 2006
    #5
  6. "David Lee Lambert" <> wrote in message
    news:p...
    > On Thu, 26 Oct 2006 11:49:17 -0700, aungkopyay wrote:
    >
    >> 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.


    You forgot about excelsior

    --
    LTP

    :)
    Luc The Perverse, Oct 27, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    552
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,688
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,722
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    637
    Arnold Peters
    Jan 5, 2005
  5. Matthias Griem
    Replies:
    6
    Views:
    551
Loading...

Share This Page