aspose file tools*
The moose likes General Computing and the fly likes how to handle space between C:\Document and Setting\ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "how to handle space between C:\Document and Setting\" Watch "how to handle space between C:\Document and Setting\" New topic
Author

how to handle space between C:\Document and Setting\

Kee Kee moon
Ranch Hand

Joined: Dec 11, 2009
Posts: 147
No, it is not just a windows command. I pass the argument into eclipse IDE window and I do use double quote. When the argument comes to the java program,
I still get errors. Apparently, the space cause the problem.

Thanks a lot.



Hi,

Please help.

I pass the argument C:\Document and Setting\...... I expect my java program to execute jar tf C:\Document and Setting\xxx\xxx\xxx.jar
However, there are spaces between C:\Document and Setting\.... and it fails to get the results.

How to resolve the issue?
Thanks in advance.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

This is a question about the Windows command line, not about Java. And in that shell, if you want a string which contains spaces to be treated as a single unit, you surround it by "quotes".
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Don't edit your question after people have answered it, it makes the answers to the original question look foolish.

As I don't like being made to look foolish, I leave it to other people to see if they dare to answer the new version of the question.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Try:

jar tf "C:\Document and Setting\xxx\xxx\xxx.jar"

like Paul said in his first response to your post.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to handle space between C:\Document and Setting\