Does Oracle have an API that shows the latest stable JDK version?
http://api.releasesoftwaremoreoften.com/latestversion?name=oraclejdk8
http://api.releasesoftwaremoreoften.com/latestversion?name=oraclejdk9

Running:

curl -s http://releasesoftwaremoreoften.com/latestversion?name=oraclejdk9 | jq .latestVersion


returns:

9.0.4


and 

curl -s http://releasesoftwaremoreoften.com/latestversion?name=oraclejdk8 | jq .latestVersion


returns:

8u162