java compiler?

G

gerrymcc

I know that javac compiles to bytecode, what does a typical C++
compile to? I'm guessing it's some sort of native machine code, so
there's no need for something like a java runtime environment. Can
Java be compiled like that? I'm wondering because if I wanted to
distribute software I'd written, I'd like it to be in a form where the
user just has to click on icon to launch the program.
Thanks for any help,
Gerard
 
L

Lothar Kimmeringer

I'm wondering because if I wanted to
distribute software I'd written, I'd like it to be in a form where the
user just has to click on icon to launch the program.

Compiling Java to machine-code is a common thread in this
newsgroup, so a searh on google or a simple scroll-back
in the thread-list should be enough to find answers.

A simple double-click on a jar-file can start the application
as well if there is a JRE installed on the system and the jar-
file contains informations about the class to be executed
when double-clicked.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
M

Marco Schmidt

(e-mail address removed):
I know that javac compiles to bytecode, what does a typical C++
compile to? I'm guessing it's some sort of native machine code, so
there's no need for something like a java runtime environment. Can
Java be compiled like that? I'm wondering because if I wanted to
distribute software I'd written, I'd like it to be in a form where the
user just has to click on icon to launch the program.

Native compilation with Java is possible, but comes at a price: <>.

Have your user install a JRE like any other plug-in. Then create an
executable JAR from your program and the user will be able to start it
by double-clicking on the corresponding icon.

Regards,
Marco
 
R

Roedy Green

I know that javac compiles to bytecode, what does a typical C++
compile to? I'm guessing it's some sort of native machine code, so
there's no need for something like a java runtime environment. Can
Java be compiled like that? I'm wondering because if I wanted to
distribute software I'd written, I'd like it to be in a form where the
user just has to click on icon to launch the program.
Thanks for any help,

C++ compiles to object code, which is very similar to a machine code
image of each method. It then has to be glued together into an EXE
file by a linker.

You can create exe files (which are then NOT platform independent
anymore) with Java too. See
http://mindprod.com/jgloss/nativecompiler.html and
http://mindprod.com/jgloss/jet.html
 
?

=?ISO-8859-1?Q?Mart_K=E4sper?=

Try GCC - it contains GCJ that makes native code out of .java/.class files.

HTH
 

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top