jar xvf <file>
So -- what if the destination is c:\destination, but the source jar
file is in c:\Documents and Settings\mydir?
cd /d c:\destination
jar xvf c:\Documents and Settings\mydir\myjar.jar
yields
java.io.FileNotFoundException: c:\Documents (The system cannot find
the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:103)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.tools.jar.Main.run(Main.java:185)
at sun.tools.jar.Main.main(Main.java:904)
jar xvf "c:\Documents and Settings\mydir\myjar.jar"
yields
The filename, directory name, or volume label syntax is incorrect.
I *can't* use unzip, which has the -d switch. Is there an equivalent
for jar? The docs seem to say no.
This is a Windows question, not a Java question.
To get Windows to recognize a pathname with embedded spaces, enclose the
pathname in double quotes:
jar xvf "c:\Documents and Settings\mydir\myjar.jar"
or even
jar xvf c:\"Documents and Settings"\mydir\myjar.jar
Ditto for any Windows command:
cd "c:\Documents and Settings\mydir"
--
Lew
Lew,
I tried the syntax you recommend; see my OP.
And, of course, after I responded I found the error of my ways. The
underlying issue was that I was launching this command from within a
VBScript using %comspec% /c "<path_to_jar.exe>" xf
"<path_to_jarfile>".
The construct for <path_to_jar.exe> was bogus. Strange that I got two
different error symptoms, though.