im getting the same exact error trying to build all my projects using spongepowered. on java 8. been getting it all day, and everyone i know has also been getting it, i heard that the serevrs were down or smthn, not sure.
Its a 520 error code which means its a server side error, however sometimes 5xx errors can be caused by the client from unpredicted things. But it does sound like a server error.
If you know what your doing you can still use traditional jdk compiling if needed
This is not error because of JDK, but it is a problem on Sponge side (not a problem actually), it seems that CloudFlare starts to deny all non-HTTPS requests (actually it redirects GETs but 520s HEADs), so Gradle can’t retrieve dependencies metas by HEADing them via HTTPS.
TL;DR if you use sponge plugin for gradle, update it to latest version (0.9.0), if not, update maven repo declaration in your build.gradle file with HTTPS protocol instead of HTTP (it should be https://repo.spongepowered.org/maven)