From: jovansonlee cesar <ivanceras@gmail.com>
To: java@gcc.gnu.org
Subject: Re: Compile java files in packages
Date: Fri, 05 Jun 2009 08:56:00 -0000 [thread overview]
Message-ID: <c20f2990906050156n7451c229gcd48397c14982a79@mail.gmail.com> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2009-06-05 8:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 7:39 Vaijayanthi Mala Suresh
[not found] ` <c20f2990906050151t3152a3d6xeff18a9a7ecbb396@mail.gmail.com>
2009-06-05 8:56 ` jovansonlee cesar [this message]
2009-06-05 10:40 ` Vaijayanthi Mala Suresh
2009-06-05 10:56 ` jovansonlee cesar
2009-06-05 11:00 ` Vaijayanthi Mala Suresh
2009-06-05 11:05 ` jovansonlee cesar
[not found] ` <6f1633170906050417r11d29691p8bb1be0e80907b13@mail.gmail.com>
2009-06-05 11:26 ` jovansonlee cesar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c20f2990906050156n7451c229gcd48397c14982a79@mail.gmail.com \
--to=ivanceras@gmail.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).