Pass JDK_HOME to gradlew directly and not through environment

Change-Id: I56ef30fd4c41b3578ae47f31ac894a4be89c4e0a
diff --git a/tools/archive_smali.py b/tools/archive_smali.py
index e19da70..4de3eef 100755
--- a/tools/archive_smali.py
+++ b/tools/archive_smali.py
@@ -104,13 +104,12 @@
             # Build release to local Maven repository compiling with JDK-11.
             m2 = os.path.join(temp, 'm2')
             os.mkdir(m2)
-            env = os.environ.copy()
-            env["JAVA_HOME"] = jdk.GetJdk11Home()
             subprocess.check_call([
                 './gradlew',
+                '-Dorg.gradle.java.home=%s' % jdk.GetJdk11Home(),
                 '-Dmaven.repo.local=%s' % m2, 'release', 'test',
                 'publishToMavenLocal',
-            ], env=env)
+            ])
             base = os.path.join('com', 'android', 'tools', 'smali')
 
             # Check that the local maven repository only has the single version directory in