This is due to gradlew being broken in pretty much all versions of recent java. Update your gradle, and be sure to set JAVA_HOME. If you are on windows, just go to advanced system setting and make sure to set a correct path. Another thing you could do is downgrade to java 8, but it is liscensed now so good luck i guess. If you need further help, just ask, I have a tutorial I could give you. I had the same problem and just uninstalled all versions of java, and reinstalled java 8 with an old installer.