From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23859 invoked by alias); 5 Jun 2009 11:05:51 -0000 Received: (qmail 23850 invoked by uid 22791); 5 Jun 2009 11:05:50 -0000 X-SWARE-Spam-Status: Yes, hits=5.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 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 11:05:44 +0000 Received: by ewy1 with SMTP id 1so2305751ewy.8 for ; Fri, 05 Jun 2009 04:05:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.210.80.17 with SMTP id d17mr3121712ebb.57.1244199940948; Fri, 05 Jun 2009 04:05:40 -0700 (PDT) In-Reply-To: <6f1633170906050400x39bc84a1g87cab64782085b60@mail.gmail.com> References: <6f1633170906050039w19a0b975g992e8de2f5069b37@mail.gmail.com> <6f1633170906050339q48335a14k70fba9b0f8212aa6@mail.gmail.com> <6f1633170906050400x39bc84a1g87cab64782085b60@mail.gmail.com> Date: Fri, 05 Jun 2009 11:05:00 -0000 Message-ID: Subject: Re: Compile java files in packages From: jovansonlee cesar To: Vaijayanthi Mala Suresh 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/msg00015.txt.bz2 Hi Vaijayanthi Mala Suresh, > if i give gcj -c ./com/test/mytest.java it gives me error. It should be Capital "-C" try it with gcj -C ./com/test/mytest.java Regards, ivanceras On Fri, Jun 5, 2009 at 7:00 PM, Vaijayanthi Mala Suresh wrote: > 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 wr= ote: >> 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 = wrote: >>>> 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.jdb= c3.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 Te= stDb.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 >>>> >>> >> >