Trying to setup a project to work with Spring MVC and google maps APIs in NetBeans 8.2(JDK 1.9.0) via Gradle.
Maybe it´s not a great mix but bear with me here please.
- I downloaded this gradle release and copied it inside C:\Gradle, ending up with: "C:\Gradle\gradle-4.10.2\bin"
- I set the java variables according to this SO answer
- I downloaded the google-maps-services-java library to use the API
- I fired up oldie goody NetBeans and downloaded the Gradle plugin
- I created a Gradle project and setup the Gradle Installation Directory and Gradle user home directory options, under Miscellaneous\Gradle, to: C:\Gradle\gradle-4.10.2
So far so good.
When I try to build the brand new project it fails and the first line in the stacktrace reads
org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Gradle\gradle-4.10.2'
which, I'll say, looks pretty self-explanatory but, why is that installation not working is beyond me.
(I'll include stacktrace if needed).
Then, just to see if I could get more hints, I tried gradle
in the console (Windows 10, I can imagine the shudders), and was greeted with:
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/4.10.2/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: --add-opens
So far, every google search I try with the stacktrace line directs me to android targeted issues and if I try the console output well, nothing useful yet.
Insights appreciated.
UPDATE:
gradle --version
outputs:
------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------
Build time: 2018-09-19 18:10:15 UTC
Revision: b4d8d5d170bb4ba516e88d7fe5647e2323d791dd
Kotlin DSL: 1.0-rc-6
Kotlin: 1.2.61
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.9.0-ea (Oracle Corporation 25.0-b62)
OS: Windows 8.1 6.3 amd64
IN THE END
This is more a why it happened than a solution
Finally, it narrowed down to incompatibility between Gradle 4.10.2 and JDK 9, so I tried with JDK 11 just to learn it does not come with a public JRE so no. After that it was JDK 10 which did not get along with NetBeans 8.2, apparently this is why. Then, I looked for NetBeans 9 only to find another obstacle: it currently does not support PHP, Javascript, C/C++ projects which I also need, only Java SE at the moment.
All of this, just to land right where I started, JDK 9. Only way forward now is using an older Gradle or sticking with Maven, darn. Advice still appreciated.