Oracle requires you to login and accept a license agreement before downloading the JDK. This is tiresome especially if your VM has no display. This is a workaround for the tiresomeness.
- Browse to http://www.oracle.com/technetwork/java/javase/downloads/index.html or go to the archive page for an older version
- Select the correct version of Java
- Accept License Agreement
- Login to Oracle - the setup file starts to download