FaqRedistributeTheJDK
Can I redistribute the Java Software Development Kit (SDK), any version, royalty-free with the NetBeans IDE?
Yes.
The SDK can be redistributed in accordance with the click-and-accept license on the web site at http://java.sun.com/.