From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19570 invoked by alias); 5 Jun 2009 08:56:46 -0000 Received: (qmail 19561 invoked by uid 22791); 5 Jun 2009 08:56:45 -0000 X-SWARE-Spam-Status: No, hits=1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42,J_CHICKENPOX_44,J_CHICKENPOX_64,SARE_MSGID_LONG40,SPF_PASS,URI_BLOGSPOT X-Spam-Check-By: sourceware.org Received: from mail-ew0-f205.google.com (HELO mail-ew0-f205.google.com) (209.85.219.205) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Jun 2009 08:56:39 +0000 Received: by ewy1 with SMTP id 1so2206903ewy.8 for ; Fri, 05 Jun 2009 01:56:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.39.2 with SMTP id m2mr2983170ebm.38.1244192196259; Fri, 05 Jun 2009 01:56:36 -0700 (PDT) In-Reply-To: References: <6f1633170906050039w19a0b975g992e8de2f5069b37@mail.gmail.com> Date: Fri, 05 Jun 2009 08:56:00 -0000 Message-ID: Subject: Re: Compile java files in packages From: jovansonlee cesar To: java@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00009.txt.bz2 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 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