Check that cli `jar` command only writes `.jar`s

Update `JarCommand` to check that the file extension of the output is
`.jar`.

Fixes gh-581