This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Compiling jar file using gcj
- From: Andrew Haley <aph at redhat dot com>
- To: Swapnil Jain <swapnil at pisces dot net dot in>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 01 Sep 2009 10:32:58 +0100
- Subject: Re: Compiling jar file using gcj
- References: <5872C486-D36C-4D9D-BB9A-3EB13639CCD4@pisces.net.in> <4A9943CF.9050302@redhat.com> <2DEA1F47-3C0F-4FA4-AACB-AF5CC63413FE@pisces.net.in> <4A9BA957.1080604@redhat.com> <4CA58F47-3BC3-4750-AC1D-6044CA5B0B9C@pisces.net.in> <4A9BB290.7050708@redhat.com> <709FC717-1B5D-426B-B6E9-AC67CCEFC7EA@pisces.net.in>
Swapnil Jain wrote:
> i am attaching the RXTXcomm.jar that i use
>
>
>
>
> --------------------------------
> Swapnil Jain
> Indore
> -----------------------------------------------
>
>
>
> On 31-Aug-09, at 4:52 PM, Andrew Haley wrote:
>
>> Swapnil Jain wrote:
>>> i am using ubuntu 9.04 32 bit desktop edition.
>>>
>>> gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
>>> gcj (Ubuntu 4.3.3-5ubuntu4) 4.3.3
>>> java version "1.6.0_14"
>>> Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
>>>
>>> i created a java project using netbeans. it uses 2 libraries
>>> RXTXcomm.jar & mysql-connector-java-5.1.7-bin.jar
>>>
>>> after building the project thru netbeans i get the iRemote.jar file in
>>> the dist folder.
>>>
>>> i want to compile it using gcj to create a binary file. i am using the
>>> following command
>>>
>>> gcj -o iRemote.sh --main=iremote.controller.Controller
>>> --classpath=RXTXcomm.jar:mysql-connector-java-5.1.7-bin.jar: iRemote.jar
>>> RXTXcomm.jar mysql-connector-java-5.1.7-bin.jar -v
>>>
>>> i am getting a segmentation fault error (file attached)
>>>
>>>
>>> i am also attaching strace of gcc & gcj
>>>
>>>
>>> kindly let me know if any more information you need.
>>
>> All files. I need to know how to get the exact same versions you
>> are using. Of course, this includes RXTXcomm.jar.
You have run into a bug where gcj gets very confused if the same file occurs
more than once on the command line. I need to look at a way to detect this
and abort with an error message instead of segfaulting.
I cannot compile your example because a chunk of native code seems to be
missing from RXTXcomm. You need to find this.
However, once you find the native code for RXTXcomm, something like
<compile the RXTX native code to native.o>
gcj -c RXTXcomm.jar -o RXTXcomm.o
gcj -c --classpath=RXTXcomm.jar iRemote.jar -o iRemote.o
gcj --main=iremote.controller.Controller native.o RXTXcomm.o iRemote.o
should work.
Andrew.