The jar tool has a bug that prevents it setting the module version without also setting the main class. A simple test to demonstrate the issue:
cat > module-info.java << EOF
module m { }
EOF
javac module-info.java
jar --create --file foo.jar module-info.class
jar --update --file foo.jar --module-version 1.0
The update fails with
'u' flag requires manifest, 'e' flag or input files to be specified!
Try `jar --help' for more information.
If the command is changed to also set the main class then it will succeed.
cat > module-info.java << EOF
module m { }
EOF
javac module-info.java
jar --create --file foo.jar module-info.class
jar --update --file foo.jar --module-version 1.0
The update fails with
'u' flag requires manifest, 'e' flag or input files to be specified!
Try `jar --help' for more information.
If the command is changed to also set the main class then it will succeed.