With the commands:
jpackage -Djlink.debug=true create-image \
--input out/artifacts \
--output out \
--limit-modules java.base \
--strip-native-commands \
--main-jar Jpackager-Hello-jar/Jpackager-Hello.jar \
--class Main
And a pre-existing output directory the output is:
invalid option [-Djlink.debug=true]
Exception: java.io.IOException: Root Directory /ws/MyProjects/Jpackager-Hello/out/Main already exists and --force is not specified"
Error: Bundler "Linux Application Image" (linux.app) failed to produce a bundle.
Comments:
- "invalid option" should be capitalized and have a colon separating it from the bad argument.
- Processing should have stopped with the invalid argument and not continue.
- The IOException class name should not be printed, the message should be sufficient.
- The "ROOT" directory should have a clear correspondence to the command line arguments as being the --input, --output, or --build-root. It is a good thing that the full path name is printed.
- The final "Error" is redundant with the other errors.
- --force could be better named and be explicitly about the output directory. perhaps --clean-output.