• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javac -classpath "white spaces"

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have noticed that if I try and use the -classpath option when compiling or running a java application, and if my classpath is something like "c:\Document and Settings\gdboling\My Program..."
I get an error because of the white spaces in the directory names. Is there a work around for this?
[ June 06, 2002: Message edited by: Gregg Bolinger ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the command line itself failing, or is the command starting and then barfing on the classpath?
If it's the CLI that's tripping over the space you could try wrapping the parameter in quotes (") which should prevent it from trying to break the parameter at the space. Or, you could always resort to the crappy PROGRA~1 notation for the folders that contain spaces.
hth,
bear
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my Windows ZP system, I experience the same problem which is resolved by enclosing the classpath setting in double quotes. Note that when amending an already established classpath, everything must be surrounded with the double quotes. This is what I'm trying to say:
javac -classpath "%classpath%;SomeAdditionalPaths" Whatever.java
Any luck?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dirk, i will try that. I think that will work though. It makes sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic