OSDN Git Service

Fix java version detection when _JAVA_OPTIONS is set.
authorPeter Ammon <pca@google.com>
Mon, 31 Mar 2014 22:36:02 +0000 (15:36 -0700)
committerPeter Ammon <pca@google.com>
Mon, 31 Mar 2014 22:36:02 +0000 (15:36 -0700)
commitbb406bf4c059fac41bd91038e7a2d2725068c057
treee6ab13c0172d6d7704c76d0c787e79d7de099da4
parent1c380c13d9bd60eefb515ea2c0a33f900a81f970
Fix java version detection when _JAVA_OPTIONS is set.

_JAVA_OPTIONS is an environment variable that
can be used to affect the behavior of java and javac.
It is currently required to get Android to build on
some configurations, where the default Java heap size
is too small. Unfortunately, if _JAVA_OPTIONS is set,
both java and javac will output its value to the console
as the first line on every invocation, including trivial
ones like java -version. This will confuse main.mk’s
version detection, which only looks at the first line of
output. Tweak the version detection to run grep before
head, so that the _JAVA_OPTIONS line is filtered by the grep.

Change-Id: I69aee52b56d27711b7d3087ec6b3ebab07ffc3af
core/main.mk