Intellij JAVA_HOME variable

后端 未结 5 1510
南旧
南旧 2021-01-31 07:00

I started using Gradle and Intellij but I am having problems to configure Gradle\'s JVM. When I start a new Gradle project I am not allowed to define JVM as my JAVA_HOME variabl

5条回答
  •  被撕碎了的回忆
    2021-01-31 07:41

    If you'd like to have your JAVA_HOME recognised by intellij, you can do one of these:

    • Start your intellij from terminal /Applications/IntelliJ IDEA 14.app/Contents/MacOS (this will pick your bash env variables)
    • Add login env variable by executing: launchctl setenv JAVA_HOME "/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home"

    To directly answer your question, you can add launchctl line in your ~/.bash_profile

    As others have answered you can ignore JAVA_HOME by setting up SDK in project structure.

提交回复
热议问题