简体   繁体   中英

Gradle 4.10.2 requires Java 7 or later to run. You are currently using Java 6 when running gradle from commandline

I am trying to learn gradle build.
I followed this link to install gradle and i followed the steps mentioned it.
https://gradle.org/install/#close-notification
After successfully following all steps i am not able to run gradle from command line.
I am using Ubuntu system.

gradle -v

FAILURE: Build failed with an exception.

* What went wrong:
Gradle 4.10.2 requires Java 7 or later to run. You are currently using Java 6.

* 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

So after uninstalling and installing back and forth still stuck in this position.

And it shows it requires Java7 and i checked it out with command

java -version

and got this output.

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)


so i dont know how to go ahead.

它可能是已设置的JAVA_HOME变量( echo $JAVA_HOME )或未设置。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM