--- old/src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java 2019-09-27 13:25:31.541578641 +0800 +++ new/src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java 2019-09-27 13:25:31.427574654 +0800 @@ -24,6 +24,7 @@ */ package jdk.jfr.internal.dcmd; +import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.InvalidPathException; @@ -105,8 +106,9 @@ if (duration == null && Boolean.FALSE.equals(dumpOnExit) && path != null) { throw new DCmdException("Filename can only be set for a time bound recording or if dumponexit=true. Set duration/dumponexit or omit filename."); } - - + if (settings.length == 1 && settings[0].length() == 0) { + throw new DCmdException("No settings specified. Use settings=none to start without any settings"); + } Map s = new HashMap<>(); if (settings == null || settings.length == 0) { @@ -116,8 +118,10 @@ for (String configName : settings) { try { s.putAll(JFC.createKnown(configName).getSettings()); + } catch(FileNotFoundException e) { + throw new DCmdException("Could not find settings file'" + configName + "'", e); } catch (IOException | ParseException e) { - throw new DCmdException("Could not parse setting " + settings[0], e); + throw new DCmdException("Could not parse settings file '" + settings[0] + "'", e); } }