the command you need is:
'wget -r
http://java.sun.com/j2se/1.5.0/docs/api/index.html'
the tool you need is wget, it comes with pretty much all Linux/unix systems. If you dont have access to one try downloading cygwin which'll let you run a unix style environment on your windows pc. Make sure you install wget with it.
There may be a wget for windows, i have never seen one, but then i havent tried looking.
EDIT:
Just to warn you, i have a copy of the Java API's on disk and it is around 200meg if you are planning on downloading it.