我在MacOS X 10.12.1與brew install gradle
安裝在運行搖籃3.2.1
,沒有設置任何ENV變量等自己,試圖使用Java 9 EA:搖籃忽略守護忽略標誌
gradle build -Dorg.gradle.java.home=~/jdk-9.jdk/Contents/Home
但構建失敗
失敗:構建失敗,出現異常。
- 出了什麼問題:無法啓動守護進程。這個問題可能是由於守護進程的配置不正確造成的。例如, 使用了無法識別的jvm選項。
據我所知,因爲守護程序試圖使用MaxPermSize參數JVM選項(未在Java中8+但在Java 8支持的,這只是一個警告)失敗。
所以,我試圖禁用該守護程序:
mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
但gradle build
仍然試圖啓動一個守護進程......我在項目目錄中刪除~/.gradle
和.gradle
。任何其他想法?
$ gradle build -Dorg.gradle.daemon=false -Dorg.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html.
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
> Starting Daemon%
是GRADLE_OPTS env變量集?另外GRADLE_USER_HOME變量會影響gradle查找屬性文件的位置...? https://docs.gradle.org/current/userguide/gradle_daemon.html – Adam
@Adam這些變量都沒有設置 –