Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle 3.3 Error Need Java 7 or Later Unsolved

Tags:

i just imported some project that i bought from my friend. Once i import it to Android Studio 2.1.2 i just get this messages "Error:Gradle 3.3 requires Java 7 or later to run. You are currently using Java 6."

I have install Java 7 and 8 in my mac. I have change the directory in Default Project Structure, but still that messages always appear and i can't do anything with the code.

Please master, help me.

like image 621
Temen Nyantai Avatar asked Mar 31 '17 06:03

Temen Nyantai


People also ask

Does Gradle 7 require Java 11?

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings.

What version of Java does Gradle use?

Gradle can only run on Java version 8 or higher. Gradle still supports compiling, testing, generating Javadoc and executing applications for Java 6 and Java 7.

Which JDK is compatible with Gradle?

For Android, performance has been improved for incremental changes in projects, especially those using the Jetifer tool to migrate libraries. Gradle now supports running on and building with Java 16, or Java Development Kit (JDK) 16, which was released on March 16.

Is Gradle compatible with Java 17?

Support for Java 17As of Gradle 7.3, both running Gradle itself and building JVM projects with Java 17 is fully supported.


2 Answers

Ran into the same issue, but I needed to keep java 6 for macOS legacy reasons (as I commented on Shubhendu's post). So I ended up downloading java 8 jdk found here

and on android studio 3.3 at least here is the rough path I took:

I right clicked project -> open module settings -> sdk location -> uncheck use embedded jdk -> added path to new 1.8 jdk which for me it was

/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home

adding java 8 idk to studio 3.3 project

like image 104
Ryhan Avatar answered Sep 24 '22 10:09

Ryhan


Use this path in the Default Project Structure by using the browse option go up to this Directory named home.

/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home

May it works for you.

like image 44
Shubham Sejpal Avatar answered Sep 22 '22 10:09

Shubham Sejpal