This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: .exe
- To: "Mohammad O'mara" <momara at iti-idsc dot gov dot eg>
- Subject: Re: .exe
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Sat, 7 Jul 2001 11:13:07 -0700 (PDT)
- Cc: java at gcc dot gnu dot org
- References: <00ed01c106e9$1d8226a0$3201000a@ellipsisdigital.com>
- Reply-To: apbianco at cygnus dot com
> how can i make an .exe file from .class or .java files using gcj ?
> .. i.e. compine all the classes of a certain application in one .exe
> file to run on linux and pentiumIII ..
There's some documentation on our website:
http://gcc.gnu.org/java/gcj2.html
http://gcc.gnu.org/java/compile.html
What is missing from there is a simple example. Say you have 2 source
file and one class file: a.java, b.java and c.class. You build objects
first, by running `gcj -c' on every files:
gcj -c a.java
gcj -c b.java
gcj -c c.class
Then you link all these objects into a single executable. --main let
you tell the compiler which class contains the main entry point. Let's
say class c in our example. You would link an executable like so:
gcj a.o b.o c.o --main=c
This produces the default `a.out' executable. Of course, once you get
tired of repeating these steps, you write a makefile, or a least a
script which is fine if you project is small.
> also , is the gcj version that comes with Linux redhat 7.1 a native
> compiler or cross compiler ?
It is a native compiler. We strongly encourage you to download and
build gcc 3.0, a much better quality compiler.
./A