Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run a java process via Powershell in Windows XP. Here's the command:

java.exe -cp .;./common.jar -Dcontext=atest1 -Dresourcepath=. DW_Install

So, the classpath is . and .\common.jar (I think java takes the wrong slashes, right?) There are two environment variables, one "atest1" the other "." and the class to execute main on is DW_Install (in the default package).

This command works in cmd.exe, but doesn't is PS. What's going on? What is PS doing while parsing this command that CMD doesn't do (or vice versa)?


share|improve this question

It is powershell interpreting the args, so you will use windows style slashes.

Also, please check your history before referring to them as 'wrong'.

share|improve this answer
Thanks for the answer. Although PS has to read the args and do some processing of them, Java.exe will be the one to parse whatever goes through PS, right? Specifically, I don't think PS will parse "./common.jar" as a path, right? Of course it will interpret the argument (and get rid of quotes, etc.), but it doesn't know to expect a path there. I was feigning ignorance about the 'wrong slashes', but thanks for the correction nonetheless. – Limited Atonement Jan 18 '11 at 16:02
up vote 0 down vote accepted

So, the answer is here. Thanks for your help. I hope this helps someone in the future!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.