Results 1 to 3 of 3
  1. #1
    mslate is offline Member
    Join Date
    Mar 2010
    Rep Power

    Smile javac on the Windows command line--whitespace in path name?

    I'm trying to compile the following using the javac command in a Windows command terminal:

    Java Code:
    javac -d C:\Program Files\.........blahblah
    The -d option is supposed to specify a path for placing the compiled "blah.class" file as described here. Unfortunately my path is "C:\Program Files\...." which has whitespace between "Program" and "Files."
    When I run the command above, I get the following error:

    javac: invalid flag: Files\.......blahlbah
    Usage: javac <options> <source files>
    use -help for a list of possible options
    I'm unsure of how to represent that space in the path name (I'm looking for a better solution than just renaming the folder "Program Files" to "ProgramFiles").

    Anyone have any ideas?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power


    Enclose it in double quotes.
    Java Code:
    javac -d "C:\Program Files\.........blahblah"
    btw this is a Windows shell consideration and is not particular to Java.


  3. #3
    mslate is offline Member
    Join Date
    Mar 2010
    Rep Power

Similar Threads

  1. Replies: 3
    Last Post: 08-14-2009, 12:57 PM
  2. javac command not recognized
    By sunshine39 in forum New To Java
    Replies: 7
    Last Post: 03-04-2009, 03:54 AM
  3. 'javac' is not recognized as an internal or external command
    By sam_1032002@btopenworld.c in forum New To Java
    Replies: 3
    Last Post: 10-18-2008, 02:40 AM
  4. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM
  5. Replies: 4
    Last Post: 07-20-2007, 04:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts