Please could you explain which of these machines are you trying to upgrade?
You'll never find a download of 10.5 on the web or in Apple's offers. You must buy the Leopard disk (and that is not easy to find nowadays). Probably you will get it from Amazon or eBay.
Apart from some specialist jiggery pokery, nor could you install Leopard on your son's 2009 machine as it would have been originally supplied with a higher level OS, Snow Leopard.
And why do you need Java. Most people disable Java nowadays as a potential source of problems.
Try Amazon > Amazon.com: Apple Mac OS X Version 10.5.6 Leopard
- Mac computer with an Intel, PowerPC G5, or PowerPC G4 (867MHz or faster) processor
- 512MB of memory
- DVD drive for installation
- 9GB of available disk space
- Some features require a compatible Internet service provider; fees may apply.