Gradle 3.3 Error Need Java 7 or Later Unsolved

Temen Nyantai picture Temen Nyantai · Mar 31, 2017 · Viewed 11.4k times · Source

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.

Answer

Ryhan picture Ryhan · Nov 17, 2017

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