jbang icon indicating copy to clipboard operation
jbang copied to clipboard

Could not invoke void dev.jbang.cli.BaseBuildCommand.setJavaVersion(java.lang.String) with ar (java.lang.IllegalArgumentException: Invalid version, should be a number optionally followed by a plus sign)

Open gastaldi opened this issue 4 years ago • 2 comments
trafficstars

/tmp ᐅ jbang -jar io.quarkus:quarkus-cli:1.13.0.Final:runner --verbose
Could not invoke void dev.jbang.cli.BaseBuildCommand.setJavaVersion(java.lang.String) with ar (java.lang.IllegalArgumentException: Invalid version, should be a number optionally followed by a plus sign)
Usage: jbang run -o [-hnV] [--[no-]cds] [--ea] [--esa] [--fresh] [--insecure]
                 [--interactive] [--jsh] --quiet --verbose [-r
                 [=<flightRecorderString>]] [-d=<debugString>]
                 [-j=<javaVersion>] [-m=<main>] [--cp=<classpaths>]...
                 [-D=<String=String>]... [--deps=<dependencies>]...
                 [--javaagent=<String=Optional>]... <scriptOrFile>
                 [<userParams>...]
Builds and runs provided script.
      <scriptOrFile>         A file with java code or if named .jsh will be run
                               with jshell
      [<userParams>...]      Parameters to pass on to the script
      --[no-]cds             If specified Class Data Sharing (CDS) will be used
                               for building and running (requires Java 13+)
      --cp, --class-path=<classpaths>
                             Add class path entries.
  -d, --debug=<debugString>  Launch with java debug enabled on specified port
                               (default: 4004)
  -D=<String=String>         set a system property
      --deps=<dependencies>  Add additional dependencies.
      --ea, --enableassertions
                             Enable assertions
      --esa, --enablesystemassertions
                             Enable system assertions
      --fresh                Make sure we use fresh (i.e. non-cached) resources.
  -h, --help                 Display help/info. Use 'jbang <command> -h' for
                               detailed usage.
      --insecure             Enable insecure trust of all SSL certificates.
      --interactive          activate interactive mode
  -j, --java=<javaVersion>   JDK version to use for running the script.
      --javaagent=<String=Optional>

      --jsh                  Force input to be interpreted with jsh/jshell
  -m, --main=<main>          Main class to use when running. Used primarily for
                               running jar's.
  -n, --native               Build using native-image
  -o, --offline              Work offline. Fail-fast if dependencies are
                               missing. No connections will be attempted
      --quiet                jbang will be quiet, only print when error occurs.
  -r, --jfr[=<flightRecorderString>]
                             Launch with Java Flight Recorder enabled.
  -V, --version              Display version info (use `jbang --verbose
                               version` for more details)
      --verbose              jbang will be verbose on what it does.

gastaldi avatar Mar 25 '21 21:03 gastaldi

ah, problem is -jar is interpreted as -j and the error handling is not done right.

maxandersen avatar Mar 25 '21 21:03 maxandersen

so not a serious regression just cosmetics of error handling

maxandersen avatar Mar 25 '21 21:03 maxandersen