how do i open a zip file on the C drive using jar

R

ros

Hello,

I have a zipped folder in the C drive and I tried to open it using a
jar command but it gave me an error which I have pasted below.

Can anybody please tell me how I can open it using jar? I know I can
use WinZip like utility but am curious how to use jar.

Thanks in advance.
Ros


C:\>jar -xvf ant_template_core_java.zip
Illegal option: û
Usage: jar {ctxu}[vfm0M] [jar-file] [manifest-file] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following
file
If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.

Example 1: to archive two class files into an archive called
classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all
the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .
 
B

Brandon McCombs

ros said:
Hello,

I have a zipped folder in the C drive and I tried to open it using a
jar command but it gave me an error which I have pasted below.

Can anybody please tell me how I can open it using jar? I know I can
use WinZip like utility but am curious how to use jar.

Thanks in advance.
Ros


C:\>jar -xvf ant_template_core_java.zip
Illegal option: û

So where exactly did you type that illegal character? I ask because it
isn't in the command that you typed above it.
Usage: jar {ctxu}[vfm0M] [jar-file] [manifest-file] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following
file
If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.

Example 1: to archive two class files into an archive called
classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all
the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .
 
R

ros

ros said:
I have a zipped folder in the C drive and I tried to open it using a
jar command but it gave me an error which I have pasted below.
Can anybody please tell me how I can open it using jar? I know I can
use WinZip like utility but am curious how to use jar.
Thanks in advance.
Ros
C:\>jar -xvf ant_template_core_java.zip
Illegal option: û

So where exactly did you type that illegal character? I ask because it
isn't in the command that you typed above it.
Usage: jar {ctxu}[vfm0M] [jar-file] [manifest-file] [-C dir] files ...
Options:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following
file
If any file is a directory then it is processed recursively.
The manifest file name and the archive file name needs to be specified
in the same order the 'm' and 'f' flags are specified.
Example 1: to archive two class files into an archive called
classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all
the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .

Actually I simply copy-pasted this command from a tutorial that I am
doing. Your remark got me thinking and I wrote this command in the
prompt and it worked.

I don't really understand where that illegal character came from as
everytime I copy-paste it from the tutorial I get this.

Thanks for the reply though.
Really appreciated.
Ros
 
L

Lew

Actually I simply copy-pasted this command from a tutorial that I am
doing. Your remark got me thinking and I wrote this command in the
prompt and it worked.

I don't really understand where that illegal character came from as
everytime I copy-paste it from the tutorial I get this.

From what did you copy? Was it a word-processing program?

Many wp programs use proprietary formats; they are binary files. They contain
all sorts of characters, like left-quotes and right-quotes, that you might not
notice. But the compiler sure does if you copy them into a source file.

I have been on more than one projects where people foolishly copied screen
prompts directly from MS Word spec documents and therefore got wrong results
because of this.
 
R

ros

From what did you copy? Was it a word-processing program?

Many wp programs use proprietary formats; they are binary files. They contain
all sorts of characters, like left-quotes and right-quotes, that you might not
notice. But the compiler sure does if you copy them into a source file.

I have been on more than one projects where people foolishly copied screen
prompts directly from MS Word spec documents and therefore got wrong results
because of this.

That explains it as I also "foolishly" copied this statement off a
webpage and pasted it in the Command Prompt!

Thanks for the explanation.
Ros
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,821
Messages
2,569,725
Members
45,511
Latest member
Osiris-Team

Latest Threads

Top