From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7440 invoked by alias); 5 Jun 2009 11:00:29 -0000 Received: (qmail 7417 invoked by uid 22791); 5 Jun 2009 11:00:24 -0000 X-SWARE-Spam-Status: No, hits=4.4 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_22,J_CHICKENPOX_34,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 qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Jun 2009 11:00:17 +0000 Received: by qw-out-1920.google.com with SMTP id 4so846858qwk.14 for ; Fri, 05 Jun 2009 04:00:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.72.79 with SMTP id l15mr2310132vcj.18.1244199613987; Fri, 05 Jun 2009 04:00:13 -0700 (PDT) In-Reply-To: References: <6f1633170906050039w19a0b975g992e8de2f5069b37@mail.gmail.com> <6f1633170906050339q48335a14k70fba9b0f8212aa6@mail.gmail.com> Date: Fri, 05 Jun 2009 11:00:00 -0000 Message-ID: <6f1633170906050400x39bc84a1g87cab64782085b60@mail.gmail.com> Subject: Re: Compile java files in packages From: Vaijayanthi Mala Suresh To: jovansonlee cesar Cc: 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/msg00014.txt.bz2 Hi ivanceras, Can you please let me know how to do it for java files within packages. For eg. I have mytest.java under com.test. if i give gcj -c ./com/test/mytest.java it gives me error. Thanks Mala On Fri, Jun 5, 2009 at 4:26 PM, jovansonlee cesar wrot= e: > 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: > =A0 =A0 =A0 $gcj -C Hello.java > that would generate Hello.class > in the same you do as(in suns jdk) > =A0 =A0 =A0 $javac Hello.java > > To run, just use > =A0 =A0 =A0$gij Hello > in the same(suns jdk) > =A0 =A0 $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 w= rote: >>> 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.jdbc= 3.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 Tes= tDb.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 >>> >> >