--- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2017-10-24 08:42:46.000000000 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2017-10-24 08:42:46.000000000 +0530 @@ -252,8 +252,16 @@ } if (options.modulePath.isEmpty()) { - throw taskHelper.newBadArgs("err.modulepath.must.be.specified") + // no --module-path specified - try to set $JAVA_HOME/jmods if that exists + Path jmods = JlinkConfiguration.getDefaultModulePath(); + if (jmods != null) { + options.modulePath.add(jmods); + } + + if (options.modulePath.isEmpty()) { + throw taskHelper.newBadArgs("err.modulepath.must.be.specified") .showUsage(true); + } } JlinkConfiguration config = initJlinkConfig();