Commit Graph

15 Commits

Author SHA1 Message Date
Colin Cross 112753ca55 Error out early on nonstandard JDK directory layouts
On Darwin, javac may be located in a nonstandard directory layout such as:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
The sed command to replace bin/javac with lib/tools.jar would fail to
match, resulting in the HOST_JDK_TOOLS_JAR being set to the javac path.
Since javac exists, the checks for missing tools.jar would all pass, and
javac would be added to the classpath instead of tools.jar, and causing
hard to debug errors about missing com.sun.javadoc when building doclava.

Change the sed command to replace /javac$, which should always be found,
with /../lib/tools.jar.

Change-Id: I5072f04636a5c14b3aeaa3a5cc3b366feae89c37
2015-10-23 19:00:43 -07:00
Bernhard Rosenkraenzer 311384fec3 Fix Java detection on some Linux distributions
On some Linux distributions (spotted here on OpenMandriva Lx, but I'm
pretty sure some others do the same thing), "which javac" returns
/usr/bin/javac, which is a symlink to "../../etc/alternatives/javac",
which in turn points at whatever the JDK the user picked as his default.

Given "../../etc/alternatives/javac" is a relative symlink, the next
iteration of LSLINE=$(ls -l "$JAVAC") fails (no ../../etc/alternatives/java
relative to the build directory), causing tools.jar not to be found.

Using realpath and readlink where possible should work in all cases.

Change-Id: Ic60ac84a5b263dc1c1f2960092a7549d1024ed2e
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-10-16 14:08:32 +02:00
Ying Wang d28feb0066 Revert "Fix Java detection on some Linux distributions"
This reverts commit 09040dd823.

Change-Id: Iafb126a6200e259f4176d903bacf8d3de28c6d97
2014-07-15 01:22:50 +00:00
Bernhard Rosenkränzer 09040dd823 Fix Java detection on some Linux distributions
On some Linux distributions (spotted here on OpenMandriva Lx, but I'm
pretty sure some others do the same thing), "which javac" returns
/usr/bin/javac, which is a symlink to "../../etc/alternatives/javac",
which in turn points at whatever the JDK the user picked as his default.

Given "../../etc/alternatives/javac" is a relative, symlink, the next
iteration of LSLINE=$(ls -l "$JAVAC") fails (no
../../etc/alternatives/java relative to the build directory), causing
tools.jar not to be found.

Using readlink -f should work in all cases (while also simplifying the
script a bit).

Change-Id: I96afcf8e6460861bf8bb849dae05c27c42b91e84
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-07-14 10:54:58 +02:00
The Android Open Source Project 324c814c6f Merge from AOSP
Change-Id: Ie444a93a1fcba693332d302de828bdc62fd61647
2011-11-11 16:03:56 -08:00
Jean-Baptiste Queru f9b556cd51 Add a hash-bang as the first line of a shell script
Change-Id: I5b663b036ecb25e952ecd2d998971cc326d4ebdf
2011-11-11 14:37:31 -08:00
Raphael Moll 2cfffcb606 am 8755e2b2: am e84739e9: Merge "Fix find-jdk-tools-jar to be cygwin-friendly."
* commit '8755e2b2c21dd54063fcb62c26c4a2d3575610cf':
  Fix find-jdk-tools-jar to be cygwin-friendly.
2011-03-11 16:05:53 -08:00
Raphael Moll 4de32c69c7 Fix find-jdk-tools-jar to be cygwin-friendly.
Change-Id: I9cf2035026725fd1ba8a014b484262ed1acc1df4
2011-03-08 14:29:25 -08:00
Ying Wang 1613f4ff1e resolved conflicts for merge of 554402f7 to master
Change-Id: Ia72f326ca91311c9eaa05aa4f5a134a60171cafb
2010-09-22 14:11:49 -07:00
Ying Wang 38a3161dc7 String literal change.
Change-Id: Ic1289ee3abb184b4617aa42c28e6eca812600463
2010-09-22 13:06:34 -07:00
Ying Wang b368bba41c Enforce 64-bit build environment
We will only support 64-bit build environment beyond froyo/2.2 .

Change-Id: I71eb1230bf0bc12ccde2aeda6255db6a87540437
2010-09-22 11:02:09 -07:00
Ying Wang ec5e729fcf Make build/core/find-jdk-tools-jar.sh fail more explicitly
http://b/issue?id=1505957
Before this change, if tools.jar can not be found, make reports error like:
make: *** No rule to make target `Please-install-JDK-5.0,-update-12-or-higher,-which-you-can-download-from-java.sun.com'...
With this change, the error message is much nicer:
build/core/config.mk:264: *** Error: could not find jdk tools.jar, please install JDK-5.0, update 12 or higher, which you can download from java.sun.com.  Stop.

Change-Id: Id33cfb6ee7676d66f00d0a41d07c1f27abc6a402
2010-07-20 16:30:40 -07:00
Angus Lees 4cf7606d7e Remove bashism from find-jdk-tools-jar.sh 2009-01-30 10:17:52 +00:00
Rod Whitby 3caa7cfa04 Detect a missing javac and provide a slightly more helpful error message.
Note the hyphens in the error message are required because the output of
this scripts is used directly in a Makefile target.

Signed-off-by: Rod Whitby <rod@whitby.id.au>
2008-10-22 11:49:14 +10:30
The Android Open Source Project b6c1cf6de7 Initial Contribution 2008-10-21 07:00:00 -07:00