From 2fcc0753c98a72ec211192fb08c12198ca8fa7bf Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Mon, 24 Jun 2019 16:07:45 +0100 Subject: Make the linter use a JAXB jar instead of the deprecated module. The linter loads JAXB classes (in the javax.xml.bind package) at runtime. Prior to this change, it was getting them by using --add-modules=java.xml-bind. This works with an OpenJDK 9 toolchain, but that module is deprecated, and it is removed in OpenJDK 11, so this approach doesn't work with an upgraded toolchain. This change drops the --add-modules option, and instead adds a JAR containing the JAXB classes. This works on all toolchain versions. Test: prebuilts/devtools/tools/lint packages/apps/Contacts Bug: 135179316 Change-Id: I8ee090152e75a6d0f7fd89bdb95a70539cd556a0 --- tools/lint | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/lint b/tools/lint index 0a54482..1441ed1 100755 --- a/tools/lint +++ b/tools/lint @@ -63,19 +63,12 @@ fi javaCmd="java" -jarpath="$frameworkdir/$jarfile" - -is_java_version_9=$(java -version 2>&1| grep 'version [ "]9.*[ "]') -if [ "${is_java_version_9}" = "" ]; then - modules_arg="" -else - modules_arg="--add-modules=java.xml.bind" -fi +jaxbJar="$ANDROID_BUILD_TOP/prebuilts/tools/common/m2/repository/javax/xml/bind/jaxb-api/2.2.12-b140109.1041/jaxb-api-2.2.12-b140109.1041.jar" +jarpath="$frameworkdir/$jarfile:$jaxbJar" exec "$javaCmd" \ -Xmx512m $os_opts $java_debug \ -Dcom.android.tools.lint.bindir="$progdir" \ -Djava.awt.headless=true \ -classpath "$jarpath" \ - ${modules_arg} \ com.android.tools.lint.Main "$@" -- cgit v1.2.3