Note because it was jammed
--Installed Java - jre 10.0.2 (Windows x64) - jdk 10.0.2 (Windows x64)
Now when I try to compile Java from the Gradle task view in Eclipse, I use the JRE and can't compile.
Working directory: C:\~~
Gradle User Home: C:\Users\~\.gradle
Gradle distribution:Gradle wrapper from target build
Gradle version: 4.9
Java home: C:\Program Files\Java\jre-10.0.2
JVM argument:None
Program arguments:None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle task: :compileJava
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 0s
1 actionable task: 1 executed
It can be done by specifying the Java home from the Eclipse execution configuration, but it is troublesome because it needs to be set for each project / task. You can write the settings in gradle.properties in your project, but I don't want to do that because the repository gets polluted with the local path.
It seems that you can set what to decide JAVA_HOME based on Gradle setting of Eclipse.
--Java_HOME http://umetyuu.hatenablog.com/entry/2015/04/14/011833 by Gradle in Eclipse
However, I don't know why, but I don't have that setting (though I think it happened when I was using Gradle for STS).
I gave up here because I want to operate only with gradlew without installing Gradle.
To specify the JRE when using gradlew:
~/.gradle/gradle.properties
org.gradle.java.home=C:\\Program Files\\Java\\jdk-10.0.2
This is also referred to when the corrected part jumps to the user home and gradlews normally, but since I plan to use Gradle only from Eclipse, I compromised with this for the time being.
Recommended Posts