From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21261 invoked by alias); 10 Aug 2009 08:57:14 -0000 Received: (qmail 21250 invoked by uid 22791); 10 Aug 2009 08:57:14 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Aug 2009 08:57:07 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7A8v5b5026658; Mon, 10 Aug 2009 04:57:05 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7A8v4Yq021032; Mon, 10 Aug 2009 04:57:04 -0400 Received: from zebedee.pink (vpn1-4-59.ams2.redhat.com [10.36.4.59]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7A8v2BD016486; Mon, 10 Aug 2009 04:57:03 -0400 Message-ID: <4A7FE0DD.4090204@redhat.com> Date: Mon, 10 Aug 2009 08:57:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20081009) MIME-Version: 1.0 To: David Michel CC: java@gcc.gnu.org Subject: Re: ant with gcc References: In-Reply-To: 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-08/txt/msg00015.txt.bz2 David Michel wrote: > I have an issue with using ant with gcc: > > While with Sun, I can simply set JAVA_HOME as such: export > JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.14/ > so that ant can find /usr/lib/jvm/java-6-sun-1.6.0.14/lib/tools.jar > (which is essentially $JAVA_HOME/lib/tools.jar) > > Somehow, I have trouble to do the same with my install of gcc: > > 'locate tools.jar' returns > '/local/gcc-4_4-branch/install/lib/jvm/lib/tools.jar' so that I've > put: export JAVA_HOME=/local/gcc-4_4-branch/install/lib/jvm/ > > But then, I get this: > > $ ant > Unable to locate tools.jar. Expected to find it in > /local/gcc-4_4-branch/install/lib/tools.jar > Buildfile: build.xml does not exist! > Build failed > > Any clues ? Ant makes some assumptions about the layout of an installed Java runtime. There are two ways you can solve this problem with gcj. 1. If you are building and installing gcc from source, it can create a JAVA_HOME directory: `--enable-java-home' If enabled, this creates a JPackage compatible SDK environment during install. Note that if -enable-java-home is used, -with-arch-directory=ARCH must also be specified. `--with-arch-directory=ARCH' Specifies the name to use for the `jre/lib/ARCH' directory in the SDK environment created when -enable-java-home is passed. Typical names for this directory include i386, amd64, ia64, etc. 2. If you are running on a GNU/Linux distro like Fedora, install the java-1.5.0-gcj package or its equivalent. Andrew.