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

    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 blah.java
    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
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

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

    db

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

Similar Threads

  1. Replies: 3
    Last Post: 08-14-2009, 01:57 PM
  2. javac command not recognized
    By sunshine39 in forum New To Java
    Replies: 7
    Last Post: 03-04-2009, 04: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, 03: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, 01:23 AM
  5. Replies: 4
    Last Post: 07-20-2007, 05: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
  •