简体   繁体   中英

Gradle sync failed: Could not determine Java version provide fix?

using executable C:\Program Files\Java\jdk-13.0.1\bin\java.exe. The project uses Gradle 4.4 which is incompatible with Java 10 or newer. See details at https://github.com/gradle/gradle/issues/4503 Possible solution: - Upgrade Gradle wr android studio is failing at building gradle and always downloading latest gradle which is not working

Check your SDKs or change your Intellij JDK

If you've upgraded a JDK recently make sure to check that the SDK paths are correct. It doesn't have to be the SDK you're currently using your project, it can be another version. To do this on MacOSX press F4 at the project to go to its project structure settings. Here click on SDKs and make sure that each Java JDK points to a valid folder. For example in my case the JDK 6 SDK pointed to a folder that no longer existed and once I updated that I could import the Gradle project. It's of course also possible to delete a JDK from IntelliJ if it has been removed from disk.

On a different occasion I ran into the same problem again but this time my JDKs all seemed to be in order so I couldn't figure out what was going on. After a good deal of trail and error I tried changing the JDK version used to start IntelliJ itself from JDK 6 to JDK 8 and this resolved the problem. To do this you need to edit the Info.plist located at /Applications/.app/Contents/Info.plist. Scroll down to the section that says JVMVersion and change its value to 1.8*. For example:

JVMVersion 1.8* Hope this will help you:)

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