Reputation: 565
I am trying to use gradle to run a local server on my windows machine. I have java version 12 on my local machine
when i run java -version
java -version
java version "12" 2019-03-19
Java(TM) SE Runtime Environment (build 12+33)
Java HotSpot(TM) 64-Bit Server VM (build 12+33, mixed mode, sharing)
I am trying to run gradle to see what version of gradle i am running and this is what i get.
gradle bootRun --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '12'.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
java.lang.IllegalArgumentException: Could not determine java version from '12'.
at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:63)
at org.gradle.api.JavaVersion.current(JavaVersion.java:72)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:32)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
at org.gra
dle.launcher.GradleMain.main(GradleMain.java:23)
I am not sure how to fix it. I also added everything to the correct environment variables
Upvotes: 2
Views: 6174
Reputation: 14500
From your report, your project is using Gradle 2.8 which was released in October 2015.
Because of its age and the need to parse Java version strings, it cannot recognise the version from a Java 12 VM.
You will need to either:
Upvotes: 5