1
votes

I want to build Android apps on a local TFS 2017 build agent - local TFS 2017 server also.

Android Studio now contains OpenJDK but I couldn't get the TFS 2017 Gradle task to work without installing Oracle's JDK. I tried creating a JAVA_HOME environment variable, using the set JAVA_HOME by JDK version in the TFS Gradle task, and the set JAVA_HOME by path in the TFS Gradle task.

Looks like having Oracle's JDK is the standard for TFS (it's installed on Microsoft's hosted build agents) but I'd like to do without because of the incoming JDK 8 licensing change.

2

2 Answers

0
votes

Unfortunately you have to install the Oracle's JDK first if you are using windows build agent, it's one of the prerequisites.

Before you set up Android Studio, be sure you have installed JDK 7 or later. The Java Runtime Environment (JRE) alone is not sufficient.

Even with the Linux agent, when you running OpenJDK, the installer will tells "SYSTEM HEALTH OpenJDK shows intermitten performance and UI issues. We recommend using the Oracle JRE/JDK" Reference this similar thread: Can Android Studio use OpenJDK or does it require Oracle JDK on Linux?

More information you can reference below articles:

0
votes

The Gradle task doesn't like a JDK path containing spaces. I couldn't get any kind of quotes to work and 8.3 name creation is disabled on the build machine.

I've created directory links with mklink /d for the 2 directories that have spaces in their names. Then in the Gradle task advanced options selected set JAVA_HOME by path and set the path to C:\Program-Files\Android\Android-Studio\jre Works fine now.