From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5769 invoked by alias); 5 Jun 2009 10:56:26 -0000 Received: (qmail 5760 invoked by uid 22791); 5 Jun 2009 10:56:26 -0000 X-SWARE-Spam-Status: No, hits=4.4 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_22,J_CHICKENPOX_42,J_CHICKENPOX_44,J_CHICKENPOX_54,J_CHICKENPOX_55,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 10:56:19 +0000 Received: by ewy1 with SMTP id 1so2298589ewy.8 for ; Fri, 05 Jun 2009 03:56:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.39.2 with SMTP id m2mr3099561ebm.38.1244199376829; Fri, 05 Jun 2009 03:56:16 -0700 (PDT) In-Reply-To: <6f1633170906050339q48335a14k70fba9b0f8212aa6@mail.gmail.com> References: <6f1633170906050039w19a0b975g992e8de2f5069b37@mail.gmail.com> <6f1633170906050339q48335a14k70fba9b0f8212aa6@mail.gmail.com> Date: Fri, 05 Jun 2009 10: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: quoted-printable 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/msg00013.txt.bz2 Hello Vaijayanthi Mala Suresh, > Can you please let me know i can generate .class files as I have > native methods defined in many of these java files for which > I need to generate the .h files as well. I have not tried generating .h files for these, and I havent even tried linking java together with c++, My main objective is really just to compile prebuilt java applications into native binary using gcj. In generating ".class" files, you could use "gcj -C" in the same way you use "javac" from sun's jdk, "gij" in the same way you could use "java" from sun jdk, Here is an example: $gcj -C Hello.java that would generate Hello.class in the same you do as(in suns jdk) $javac Hello.java To run, just use $gij Hello in the same(suns jdk) $java Hello Regards, ivanceras On Fri, Jun 5, 2009 at 6:39 PM, Vaijayanthi Mala Suresh wrote: > Hi ivanceras, > > Thanks for your help. > > Can you please let me know i can generate .class files as I have > native methods defined in many of these java files for which > I need to generate the .h files as well. > > Thanks > Mala > > On Fri, Jun 5, 2009 at 2:26 PM, jovansonlee cesar wr= ote: >> Hi Vaijayanthi Mala Suresh, >> >> Here is my little example: >> http://ivanceras.blogspot.com/2009/04/gcj-vs-jvm-benchmark.html >> >> =A0 =A0$gcj -c -g -O Test.java >> =A0 =A0$gcj --main=3DTest -o Test.bin Test.o >> =A0 =A0$./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 >> >> =A0Compiling, Linking and Running in GCJ: >> >> =A0compile the PostgreSQL jdbc driver >> =A0 $gcj -c -g -O postgresql-8.4dev-700.jdbc3.jar >> =A0 This will create the native binary file "postgresql-8.4dev-700.jdbc3= .o" >> >> =A0compile the Test >> =A0 $gcj -c -g -O TestDb.java >> =A0This will create the native binay file "TestDb.o" >> >> =A0 do the linking >> =A0$gcj --main=3DTestDb -o TestDb.bin postgresql-8.4dev-700.jdbc3.o Test= Db.o >> =A0This will create the executable file: "TestDb.bin" >> >> =A0execute >> =A0$./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 >> >