Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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)?

Aaron

share|improve this question

2 Answers 2

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

 
discard

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.