This is officially supported in JDK 9. It's part of an ongoing project called "jigsaw" which is introducing modules to the JVM. The first step, shipping in 9, is to modularize the JDK [0].
Already today you can build a custom JDK in the early access release.
Already today you can build a custom JDK in the early access release.
[0] http://openjdk.java.net/jeps/200