Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
939 views
in Technique[技术] by (71.8m points)

gradle - Intellij idea says Java Home is Different

The newly created daemon process has a different context than expected. It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.

Wanted:DefaultDaemonContext[uid=null,javaHome=/home/administrator/Downloads/idea-IU-145.1617.8/jre,daemonRegistryDir=/home/administrator/.gradle/daemon,pid=11963,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IN,-Duser.language=en,-Duser.variant]

Actual: DefaultDaemonContext[uid=4839fb8c-418b-4666-9a66-40a60133958a,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/administrator/.gradle/daemon,pid=15202,idleTimeout=60000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=IN,-Duser.language=en,-Duser.variant]

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Be sure to check and correct JDK version in these 3 places:

  1. Check Preferences -> Build,... -> Build Tools -> Gradle -> Gradle JVM: Gradle Preferences
  2. Check Project Structure -> Project Settings -> Project -> Project SDK:
    Project
  3. Check Project Structure -> Platform Settings -> SDKs: SDKs

Fixing gradle.properties is a dirty workaround. Better fix this at the IDE level.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...