This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Compile java files in packages
- From: jovansonlee cesar <ivanceras at gmail dot com>
- To: java at gcc dot gnu dot org
- Date: Fri, 5 Jun 2009 16:56:36 +0800
- Subject: Re: Compile java files in packages
- References: <6f1633170906050039w19a0b975g992e8de2f5069b37@mail.gmail.com> <c20f2990906050151t3152a3d6xeff18a9a7ecbb396@mail.gmail.com>
Hi Vaijayanthi Mala Suresh,
Here is my little example:
http://ivanceras.blogspot.com/2009/04/gcj-vs-jvm-benchmark.html
$gcj -c -g -O Test.java
$gcj --main=Test -o Test.bin Test.o
$./Test.bin
and here's how you would compile jar library file(ie. postgresql jdbc
driver) and link it to your main class
http://ivanceras.blogspot.com/2009/05/gcc-vs-jvm-benchmark-2.html
Compiling, Linking and Running in GCJ:
compile the PostgreSQL jdbc driver
$gcj -c -g -O postgresql-8.4dev-700.jdbc3.jar
This will create the native binary file "postgresql-8.4dev-700.jdbc3.o"
compile the Test
$gcj -c -g -O TestDb.java
This will create the native binay file "TestDb.o"
do the linking
$gcj --main=TestDb -o TestDb.bin postgresql-8.4dev-700.jdbc3.o TestDb.o
This will create the executable file: "TestDb.bin"
execute
$./TestDb.bin
Please visit the blog for more details :)
Regards,
ivanceras
(PS: have to resend, mailist don't seem to accept html text)
On Fri, Jun 5, 2009 at 3:39 PM, Vaijayanthi Mala Suresh
<vaijayanthimalas@gmail.com> wrote:
>
> Hi,
>
> I have a several packages of java files which I need to compile with
> gcj to generate .class and .o files.
>
> Can anyone help me please.
>
> Thanks
> Mala