JDK-8194928 : Provide better help message for javac -h case
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2018-01-11
  • Updated: 2018-01-11
  • Resolved: 2018-01-11
Related Reports
Relates :  
Description
Use of javac -h to specify output directory for native headers is quite confusing. 

#/jdk/bin/javac -h
javac: -h requires an argument
Usage: javac <options> <source files>
use --help for a list of possible options

#/jdk/bin/javac -h bootclasspath
javac: no source files
Comments
There's nothing that can be done here. javac is doing as expected. Without an argument, javac gives a reasonable message. With a reasonable argument (the name of a directory that could be created if needed), the argument is accepted, and javac continues checking arguments, and correctly reports no input files.
11-01-2018