Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

spaces in JVM arguments

843811May 2 2005 — edited May 3 2005
On Windows, I want to hand a directory path to the JVM in the following way
java -Dworking.dir=<mydir>
Unfortunately, the <mydir> is provided by the %USERPROFILE% environment variable and
contains whitespace (c:\documents and settings\username). How can I quote this argument to prevent the JVM from complaining about the bad option 'and' which supposedly starts after the first whitespace?

Thanks a lot
Andreas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2005
Added on May 2 2005
4 comments
3,984 views