ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From glenn opdycke-hansen <glenn...@gmail.com>
Subject Re: BUILD FAILED "Perhaps JAVA_HOME does not point to the JDK" ...
Date Wed, 26 Oct 2011 00:01:01 GMT
The java -version will indicate that a JRE is present.  Try javac -version
This will test if a JDK is available


glennop@uphen:~$ java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre10-0ubuntu5)
OpenJDK Server VM (build 20.0-b11, mixed mode)
glennop@uphen:~$ javac -version
javac 1.6.0_23

Then check if the JDK is on the PATH.

--glenn



On Mon, Oct 24, 2011 at 16:49, Albretch Mueller <lbrtchx@gmail.com> wrote:
>  Hi,
> ~
>  I have been trying to fix this error message but I am not able to see
> exactly what is causing it
> ~
>  It may relate to the fact that I am trying to compile
> gdata-java-client for youtube using  knoppix (Debian-based live CD (I
> need for it to be like that)) but I can't imagine "tools.jar" was not
> included in this version of java (open-jdk) ... or?
> ~
> $ uname -a
> Linux Microknoppix 2.6.39.3 #21 SMP PREEMPT Sat Jul 23 09:48:39 CEST
> 2011 i686 GNU/Linux
> ~
> $ java -version
> java version "1.6.0_18"
> OpenJDK Runtime Environment (IcedTea6 1.8.7) (6b18-1.8.7-2~squeeze1)
> OpenJDK Server VM (build 14.0-b16, mixed mode)
> ~
> $ ant -version
> Unable to locate tools.jar. Expected to find it in
> /UNIONFS/usr/lib/jvm/java-6-openjdk/lib/tools.jar
> Apache Ant(TM) version 1.8.2 compiled on December 20 2010
> ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~
> $ pwd
> /media/sda7/inst/java/jars/gdata-java-client
>
> $ wget http://gdata-java-client.googlecode.com/files/gdata-samples.java-1.46.0.zip
> --2011-10-24 16:56:39--
> http://gdata-java-client.googlecode.com/files/gdata-samples.java-1.46.0.zip
> Resolving gdata-java-client.googlecode.com... 74.125.91.82
> Connecting to gdata-java-client.googlecode.com|74.125.91.82|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 12479380 (12M) [application/octet-stream]
> Saving to: `gdata-samples.java-1.46.0.zip'
>
> 100%[=========================================================================================>]
> 12,479,380   149K/s   in 86s
>
> 2011-10-24 16:58:05 (141 KB/s) - `gdata-samples.java-1.46.0.zip' saved
> [12479380/12479380]
>
> $ wget http://gdata-java-client.googlecode.com/files/gdata-src.java-1.46.0.zip
> --2011-10-24 17:02:59--
> http://gdata-java-client.googlecode.com/files/gdata-src.java-1.46.0.zip
> Resolving gdata-java-client.googlecode.com... 74.125.93.82
> Connecting to gdata-java-client.googlecode.com|74.125.93.82|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 11264317 (11M) [application/octet-stream]
> Saving to: `gdata-src.java-1.46.0.zip'
>
> 100%[=========================================================================================>]
> 11,264,317   134K/s   in 83s
>
> 2011-10-24 17:04:22 (133 KB/s) - `gdata-src.java-1.46.0.zip' saved
> [11264317/11264317]
>
> $ ls -l
> total 23416
> -rw-r--r-- 1 knoppix knoppix    91932 Oct 24 17:01 gdata-samples.java-1.46.0.png
> -rw-r--r-- 1 knoppix knoppix 12479380 Sep 14 15:05 gdata-samples.java-1.46.0.zip
> -rw-r--r-- 1 knoppix knoppix    91395 Oct 24 17:03 gdata-src.java-1.46.0.png
> -rw-r--r-- 1 knoppix knoppix 11264317 Sep 14 15:04 gdata-src.java-1.46.0.zip
>
> $ sha1sum -b *.zip
> 08c9bd94eb2835ddb6baacbef5b2a52cefc0b0d7 *gdata-samples.java-1.46.0.zip
> 62ab7fc53fcd91a30d4419f9e8bb31878ae085af *gdata-src.java-1.46.0.zip
>
>  * both sha1 signatures checked OK!
>
> $ unzip gdata-src.java-1.46.0.zip
> Archive:  gdata-src.java-1.46.0.zip
>  inflating: gdata/COPYING
>  inflating: gdata/INSTALL-src.txt
>  inflating: gdata/README-src.txt
>  inflating: gdata/RELEASE_NOTES.txt
>   creating: gdata/java/manifest/
> ...
>  inflating: gdata/java/doc/package-list
>   creating: gdata/java/doc/resources/
>  extracting: gdata/java/doc/resources/inherit.gif
>   creating: gdata/java/deps/
>  inflating: gdata/java/deps/google-collect-1.0-rc1.jar
>  inflating: gdata/java/deps/jsr305.jar
>
> $ unzip gdata-samples.java-1.46.0.zip
>
> $ unzip gdata-samples.java-1.46.0.zip
> Archive:  gdata-samples.java-1.46.0.zip
> replace gdata/COPYING? [y]es, [n]o, [A]ll, [N]one, [r]ename: ^C
>
> $ pwd
> /media/sda7/inst/java/jars/gdata-java-client/samples
>
> $ unzip gdata-samples.java-1.46.0.zip
> Archive:  gdata-samples.java-1.46.0.zip
>  inflating: gdata/COPYING
>  inflating: gdata/INSTALL-samples.txt
>  inflating: gdata/README-samples.txt
>  inflating: gdata/RELEASE_NOTES.txt
>  inflating: gdata/java/build-samples.xml
>  inflating: gdata/java/version.properties
>   creating: gdata/java/build-samples/
> ...
>  inflating: gdata/java/doc/package-list
>   creating: gdata/java/doc/resources/
>  extracting: gdata/java/doc/resources/inherit.gif
>   creating: gdata/java/deps/
>  inflating: gdata/java/deps/google-collect-1.0-rc1.jar
>  inflating: gdata/java/deps/jsr305.jar
>
> $
>
> $ pwd
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java
>
> $ ls -l
> total 32
> drwxr-x--- 2 knoppix knoppix 4096 Sep  6 19:37 build-src
> -rw------- 1 knoppix knoppix 3707 Sep  9 19:14 build-src.xml
> drwxr-x--- 2 knoppix knoppix 4096 Sep  6 19:37 deps
> drwxr-x--- 4 knoppix knoppix 4096 Sep  9 19:20 doc
> drwxr-x--- 2 knoppix knoppix 4096 Sep  9 19:18 lib
> drwxr-x--- 2 knoppix knoppix 4096 Sep  6 19:37 manifest
> drwxr-x--- 3 knoppix knoppix 4096 Sep  9 19:14 src
> -rw------- 1 knoppix knoppix 1293 Sep  9 19:14 version.properties
>
> $ ant build-src.xml
> Unable to locate tools.jar. Expected to find it in
> /UNIONFS/usr/lib/jvm/java-6-openjdk/lib/tools.jar
> Buildfile: build.xml does not exist!
> Build failed
>
> $ ant --help | grep buildfile
>  -buildfile <file>      use given buildfile
>  -find <file>           (s)earch for buildfile towards the root of
>
> $ ant -buildfile build-src.xml
> Unable to locate tools.jar. Expected to find it in
> /UNIONFS/usr/lib/jvm/java-6-openjdk/lib/tools.jar
> Buildfile: /media/sda7/inst/java/jars/gdata-java-client/gdata/java/build-src.xml
>
> dirs:
>    [mkdir] Created dir:
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java/classes
>
> build.manifest:
>    [mkdir] Created dir:
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java/genfiles/manifest
>     [copy] Copying 23 files to
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java/genfiles/manifest
>
> build.core.base:
>    [mkdir] Created dir:
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java/classes/core
>    [javac] /media/sda7/inst/java/jars/gdata-java-client/gdata/java/build-src/core.xml:257:
> warning: 'includeantruntime' was not set, defaulting to
> build.sysclasspath=last; set to false for repeatable builds
>
> BUILD FAILED
> /media/sda7/inst/java/jars/gdata-java-client/gdata/java/build-src/core.xml:257:
> Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK.
> It is currently set to "/UNIONFS/usr/lib/jvm/java-6-openjdk/jre"
>
> Total time: 4 seconds
>
> $ echo $JAVA_HOME
>
> $
>
> $ which java
> /usr/bin/java
>
> $ ls -l `which java`
> lrwxrwxrwx 1 root root 22 Aug 27  2010 /usr/bin/java -> /etc/alternatives/java
>
> $ ls -l /etc/alternatives/java
> lrwxrwxrwx 1 root root 40 Aug 27  2010 /etc/alternatives/java ->
> /usr/lib/jvm/java-6-openjdk/jre/bin/java
>
> $ export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
>
> $ echo $JAVA_HOME
> /usr/lib/jvm/java-6-openjdk
>
> $ ls -l /usr/lib/jvm/java-6-openjdk/jre/bin/java
> -rwxr-xr-x 1 root root 34788 Apr 20  2011
> /usr/lib/jvm/java-6-openjdk/jre/bin/java
>
> $ ls -l /usr/lib/jvm/java-6-openjdk/jre/bin
> total 503
> -rwxr-xr-x 1 root root  34788 Apr 20  2011 java
> -rwxr-xr-x 1 root root    148 Apr 20  2011 javaws
> -rwxr-xr-x 1 root root  35520 Apr 20  2011 javaws.real
> -rwxr-xr-x 1 root root  34880 Apr 20  2011 keytool
> -rwxr-xr-x 1 root root  34936 Apr 20  2011 orbd
> -rwxr-xr-x 1 root root  34812 Apr 20  2011 pack200
> -rwxr-xr-x 1 root root  35016 Apr 20  2011 pluginappletviewer
> -rwxr-xr-x 1 root root  35216 Apr 20  2011 policytool
> -rwxr-xr-x 1 root root  34880 Apr 20  2011 rmid
> -rwxr-xr-x 1 root root  34888 Apr 20  2011 rmiregistry
> -rwxr-xr-x 1 root root  34900 Apr 20  2011 servertool
> -rwxr-xr-x 1 root root  34968 Apr 20  2011 tnameserv
> -rwxr-xr-x 1 root root 126124 Apr 20  2011 unpack200
>
> $ ls -l /usr/lib/jvm/java-6-openjdk/jre
> total 139
> -rw-r--r-- 1 root root   1503 Apr 19  2011 ASSEMBLY_EXCEPTION
> -rw-r--r-- 1 root root 127498 Apr 19  2011 THIRD_PARTY_README
> drwxr-xr-x 2 root root   2048 Jun 17 09:41 bin
> drwxr-xr-x 9 root root   8192 Jun 17 09:41 lib
> drwxr-xr-x 4 root root   2048 Aug 27  2010 man
>
> $ ls -l /usr/lib/jvm/java-6-openjdk
> total 8
> drwxr-xr-x 2 root root 4096 Jul  8 02:05 bin
> lrwxrwxrwx 1 root root   41 Aug 27  2010 docs ->
> ../../../share/doc/openjdk-6-jre-headless
> drwxr-xr-x 5 root root 2048 Jun 17 09:41 jre
> drwxr-xr-x 4 root root 2048 Aug 27  2010 man
>
> $ ls -l /usr/lib/jvm
> total 2
> lrwxrwxrwx 1 root root   14 Aug 27  2010 default-java -> java-6-openjdk
> lrwxrwxrwx 1 root root   14 Aug 27  2010 java-1.6.0-openjdk -> java-6-openjdk
> drwxr-xr-x 5 root root 2048 Jul  8 02:05 java-6-openjdk
>
>
> $ ls -l ls -l /usr/lib/jvm/java-6-openjdk/jre/lib
> ls: cannot access ls: No such file or directory
> /usr/lib/jvm/java-6-openjdk/jre/lib:
> total 66304
> -rw-r--r-- 1 root root    17784 Apr 19  2011 about.jar
> -rw-r--r-- 1 root root      607 Apr 19  2011 about.jnlp
> lrwxrwxrwx 1 root root       44 Jun 17 09:41 accessibility.properties
> -> /etc/java-6-openjdk/accessibility.properties
> lrwxrwxrwx 1 root root       40 Jun 17 09:41 calendars.properties ->
> /etc/java-6-openjdk/calendars.properties
> -rw-r--r-- 1 root root  3534509 Apr 19  2011 charsets.jar
> -rw-r--r-- 1 root root    78219 Apr 19  2011 classlist
> drwxr-xr-x 2 root root     2048 Jun 17 09:41 cmm
> -rw-r--r-- 1 root root     1497 Apr 19  2011 compilefontconfig.jar
> lrwxrwxrwx 1 root root       44 Jun 17 09:41 content-types.properties
> -> /etc/java-6-openjdk/content-types.properties
> -rw-r--r-- 1 root root     4049 Apr 19  2011 currency.data
> drwxr-xr-x 2 root root     2048 Jun 17 09:41 ext
> lrwxrwxrwx 1 root root       40 Jun 17 09:41 flavormap.properties ->
> /etc/java-6-openjdk/flavormap.properties
> lrwxrwxrwx 1 root root       34 Jun 17 09:41 fontconfig.bfc ->
> /etc/java-6-openjdk/fontconfig.bfc
> lrwxrwxrwx 1 root root       41 Jun 17 09:41 fontconfig.properties ->
> /etc/java-6-openjdk/fontconfig.properties
> drwxr-xr-x 9 root root     6144 Aug  1 04:45 i386
> drwxr-xr-x 2 root root     2048 Jun 17 09:41 im
> drwxr-xr-x 3 root root     2048 Aug 27  2010 images
> -rw-r--r-- 1 root root       62 Apr 20  2011 jar.binfmt
> -rw-r--r-- 1 root root    44385 Apr 19  2011 javazic.jar
> -rw-r--r-- 1 root root    85243 Apr 19  2011 jce.jar
> -rwxr-xr-x 1 root root     4940 Apr 20  2011 jexec
> -rw-r--r-- 1 root root   521610 Apr 19  2011 jsse.jar
> -rw-r--r-- 1 root root     4224 Apr 19  2011 jvm.hprof.txt
> lrwxrwxrwx 1 root root       38 Jun 17 09:41 logging.properties ->
> /etc/java-6-openjdk/logging.properties
> drwxr-xr-x 2 root root     2048 Jun 17 09:41 management
> -rw-r--r-- 1 root root      385 Apr 19  2011 management-agent.jar
> -rw-r--r-- 1 root root     2216 Apr 19  2011 meta-index
> lrwxrwxrwx 1 root root       34 Jun 17 09:41 net.properties ->
> /etc/java-6-openjdk/net.properties
> lrwxrwxrwx 1 root root       40 Jun 17 09:41 psfont.properties.ja ->
> /etc/java-6-openjdk/psfont.properties.ja
> lrwxrwxrwx 1 root root       40 Jun 17 09:41 psfontj2d.properties ->
> /etc/java-6-openjdk/psfontj2d.properties
> -rw-r--r-- 1 root root  1083793 Apr 19  2011 resources.jar
> -rw-r--r-- 1 root root   901842 Apr 19  2011 rhino.jar
> -rw-r--r-- 1 root root 61587347 Apr 19  2011 rt.jar
> drwxr-xr-x 2 root root     2048 Jun 17 09:41 security
> lrwxrwxrwx 1 root root       36 Jun 17 09:41 sound.properties ->
> /etc/java-6-openjdk/sound.properties
> lrwxrwxrwx 1 root root       36 Jun 17 09:41 swing.properties ->
> /etc/java-6-openjdk/swing.properties
> -rw-r--r-- 1 root root       35 Apr 19  2011 tz.properties
> lrwxrwxrwx 1 root root       27 Nov  1  2010 zi -> ../../../../../share/javazi
>
> $ sudo find /usr/lib -type f -name tools.jar
>
> $ sudo find /etc -type f -name tools.jar
>
> $ sudo find / -type f -name tools.jar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message