Skip to content
Advertisement

How to use the command “Jar x “?

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

  1. Enter jar x,press the Enter key.
  2. Enter TicTacToe.jar(what i want to extract sth from),press the Enter key.
  3. 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?

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); or
  • jar x < file.jar

Same true when creating a JAR file, without f option, data is written to standard output.

Advertisement