Android Studio 3.6 отображает следующее предупреждение после завершения Gradle syn c:
15:51 Gradle sync finished in 27 s 97 ms
15:51 Android Studio is using the following JDK location when running Gradle:
/home/azabost/java/jdk8u252-b09
Using different JDK locations on different processes might cause Gradle to
spawn multiple daemons, for example, by executing Gradle tasks from a terminal
while using Android Studio.
Я понятия не имею, почему я это вижу и имеет ли это какой-то смысл. Проекты строятся нормально, без каких-либо проблем. Я работаю в системе sh Ubuntu, где я установил AdoptOpenJDK на /home/azabost/java/jdk8u252-b09
и Android Studio 3.6 на /home/azabost/bin/android-studio-3.6
. Я экспортировал несколько связанных с JDK путей: JAVA_HOME
, JDK_HOME
и STUDIO_JDK
, чтобы Android Studio могла правильно подобрать мой JDK. Ниже приведены результаты нескольких команд, показывающих правильное расположение JDK:
$ which java
/home/azabost/java/jdk8u252-b09/bin/java
$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
$ export | grep java
JAVA_HOME=/home/azabost/java/jdk8u252-b09
JDK_HOME=/home/azabost/java/jdk8u252-b09
PATH=/home/azabost/bin:/home/azabost/java/jdk8u252-b09/bin:/home/azabost/bin/android-sdk/platform-tools:/home/azabost/bin/android-sdk/emulator:/home/azabost/bin/android-sdk/cmdline-tools/latest/bin:/home/azabost/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
STUDIO_JDK=/home/azabost/java/jdk8u252-b09
./gradlew --version
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------
Build time: 2020-03-24 19:52:07 UTC
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
Kotlin: 1.3.70
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_252 (AdoptOpenJDK 25.252-b09)
OS: Linux 5.4.0-28-generic amd64
Когда я открываю диалоговое окно Project Stucture в Android Studio, я вижу правильный JDK установлено. Но когда я щелкаю в раскрывающемся меню, чтобы выбрать другой JDK, я вижу что-то странное. Есть 2 варианта:
- Встроенный JDK: /home/azabost/bin/android-studio-3.6/jre
- JAVA_HOME: / home / azabost / bin / android -studio-3.6 / jre
Итак, встроенный JDK указан дважды , включая тот, что с описанием "JAVA_HOME", что странно, потому что, как вы могли видеть, мой JAVA_HOME
переменная указывает на другой JDK. Я не уверен, связана ли эта конкретная проблема с предупреждением, которое я вижу.
И это то, что я вижу в файле ~/.AndroidStudio3.6/config/options/jdk.table.xml
:
cat ~/.AndroidStudio3.6/config/options/jdk.table.xml
<application>
<component name="ProjectJdkTable">
<jdk version="2">
<name value="1.8" />
<type value="JavaSDK" />
<version value="java version "1.8.0_252"" />
<homePath value="$USER_HOME$/java/jdk8u252-b09" />
<roots>
<annotationsPath>
<root type="composite">
<root url="jar://$APPLICATION_HOME_DIR$/plugins/java/lib/jdkAnnotations.jar!/" type="simple" />
</root>
</annotationsPath>
<classPath>
<root type="composite">
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/charsets.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/cldrdata.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/dnsns.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/jaccess.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/localedata.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/nashorn.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/sunec.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/sunjce_provider.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/sunpkcs11.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/ext/zipfs.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/jce.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/jsse.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/management-agent.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/resources.jar!/" type="simple" />
<root url="jar://$USER_HOME$/java/jdk8u252-b09/jre/lib/rt.jar!/" type="simple" />
</root>
</classPath>
<javadocPath>
<root type="composite" />
</javadocPath>
<sourcePath>
<root type="composite">
<root url="jar://$USER_HOME$/java/jdk8u252-b09/src.zip!/" type="simple" />
</root>
</sourcePath>
</roots>
<additional />
</jdk>
<jdk version="2">
<name value="Android API 29 Platform" />
<type value="Android SDK" />
<version value="java version "1.8.0_252"" />
<homePath value="$USER_HOME$/bin/android-sdk" />
<roots>
<annotationsPath>
<root type="composite">
<root url="jar://$APPLICATION_HOME_DIR$/plugins/android/lib/androidAnnotations.jar!/" type="simple" />
</root>
</annotationsPath>
<classPath>
<root type="composite">
<root url="jar://$USER_HOME$/bin/android-sdk/platforms/android-29/android.jar!/" type="simple" />
<root url="file://$USER_HOME$/bin/android-sdk/platforms/android-29/data/res" type="simple" />
</root>
</classPath>
<javadocPath>
<root type="composite" />
</javadocPath>
<sourcePath>
<root type="composite">
<root url="file://$USER_HOME$/bin/android-sdk/sources/android-29" type="simple" />
</root>
</sourcePath>
</roots>
<additional jdk="1.8" sdk="android-29" />
</jdk>
<jdk version="2">
<name value="Kotlin SDK" />
<type value="KotlinSDK" />
<homePath value="$KOTLIN_BUNDLED$" />
<roots>
<annotationsPath>
<root type="composite" />
</annotationsPath>
<classPath>
<root type="composite" />
</classPath>
<javadocPath>
<root type="composite" />
</javadocPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional />
</jdk>
<jdk version="2">
<name value="1.8 (2)" />
<type value="JavaSDK" />
<version value="java version "1.8.0_212"" />
<homePath value="$APPLICATION_HOME_DIR$/jre" />
<roots>
<annotationsPath>
<root type="composite">
<root url="jar://$APPLICATION_HOME_DIR$/plugins/java/lib/jdkAnnotations.jar!/" type="simple" />
</root>
</annotationsPath>
<classPath>
<root type="composite">
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/charsets.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/cldrdata.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/dnsns.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/jaccess.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/localedata.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/nashorn.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/sunec.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/sunjce_provider.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/sunpkcs11.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/ext/zipfs.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/jce.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/jsse.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/management-agent.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/resources.jar!/" type="simple" />
<root url="jar://$APPLICATION_HOME_DIR$/jre/jre/lib/rt.jar!/" type="simple" />
</root>
</classPath>
<javadocPath>
<root type="composite">
<root url="https://docs.oracle.com/javase/8/docs/api/" type="simple" />
</root>
</javadocPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional />
</jdk>
<jdk version="2">
<name value="Android API 28 Platform" />
<type value="Android SDK" />
<version value="java version "1.8.0_212"" />
<homePath value="$USER_HOME$/bin/android-sdk" />
<roots>
<annotationsPath>
<root type="composite">
<root url="jar://$USER_HOME$/bin/android-sdk/platforms/android-28/data/annotations.zip!/" type="simple" />
</root>
</annotationsPath>
<classPath>
<root type="composite">
<root url="jar://$USER_HOME$/bin/android-sdk/platforms/android-28/android.jar!/" type="simple" />
<root url="file://$USER_HOME$/bin/android-sdk/platforms/android-28/data/res" type="simple" />
</root>
</classPath>
<javadocPath>
<root type="composite" />
</javadocPath>
<sourcePath>
<root type="composite">
<root url="file://$USER_HOME$/bin/android-sdk/sources/android-28" type="simple" />
</root>
</sourcePath>
</roots>
<additional jdk="1.8 (2)" sdk="android-28" />
</jdk>
</component>
</application>%
И согласно ps -x
Android Studio запущена с использованием встроенного JDK:
ps -x | grep studio
28805 ? S 0:00 /bin/sh /home/azabost/bin/android-studio-3.6/bin/studio.sh
28908 ? Sl 5:06 /home/azabost/bin/android-studio-3.6/jre/bin/java -classpath /home/azabost/bin/android-studio-3.6/lib/bootstrap.jar:/home/azabost/bin/android-studio-3.6/lib/extensions.jar:/home/azabost/bin/android-studio-3.6/lib/util.jar:/home/azabost/bin/android-studio-3.6/lib/jdom.jar:/home/azabost/bin/android-studio-3.6/lib/log4j.jar:/home/azabost/bin/android-studio-3.6/lib/trove4j.jar:/home/azabost/bin/android-studio-3.6/lib/jna.jar:/home/azabost/bin/android-studio-3.6/jre/lib/tools.jar -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Djna.nosys=true -Djna.boot.library.path= -da -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dsun.tools.attach.tmp.only=true -Xmx3072m -XX:ErrorFile=/home/azabost/java_error_in_STUDIO_%p.log -XX:HeapDumpPath=/home/azabost/java_error_in_STUDIO.hprof -Didea.paths.selector=AndroidStudio3.6 -Djb.vmOptionsFile=/home/azabost/bin/android-studio-3.6/bin/studio64.vmoptions,/home/azabost/.AndroidStudio3.6/config/studio64.vmoptions -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true com.intellij.idea.Main