I’ve just started studying Java.
I know I can extract a jar file with command jar xf jarname.jar
But I’m confused about this [command jar x
and useless new lines]jar x and new lines
- Enter
jar x
,press the Enter key. - Enter
TicTacToe.jar
(what i want to extract sth from),press the Enter key. - Nothing else happened expect generating a new line.
Please tell me why
Can’t ‘x’ be used by itself?
Or
I should use some special command in cmd?
Advertisement
Answer
If no f
option is given to specify an archive file, data (not its name) is read from standard input like in:
cat file.jar | jar x
;type file.jar | jar x
(Windows); orjar x < file.jar
Same true when creating a JAR file, without f
option, data is written to standard output.