Results 1 to 8 of 8
  1. #1
    waao is offline Member
    Join Date
    Aug 2011
    Posts
    7
    Rep Power
    0

    Default I try to compile my source code, However it says javac: file not found: Hello.java

    Hey,
    I am trying to compile my source code i saved it as Hello.java on desktop but when i type into cmd:
    javac Hello.java

    It says:
    Java Code:
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\Havard>javac Hello.java
    javac: file not found: Hello.java
    Usage: javac <options> <source files>
    use -help for a list of possible options
    
    C:\Users\Havard>
    I have java jdk and java installed i have set my environ mental lables up to jdk bin for path..

    Please help thanks!
    P.S this might be wrong section not sure

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,023
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by waao View Post
    Hey,
    I am trying to compile my source code i saved it as Hello.java on desktop but when i type into cmd:
    javac Hello.java

    It says:
    Java Code:
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\Havard>javac Hello.java
    javac: file not found: Hello.java
    Usage: javac <options> <source files>
    use -help for a list of possible options
    
    C:\Users\Havard>
    I have java jdk and java installed i have set my environ mental lables up to jdk bin for path..

    Please help thanks!
    P.S this might be wrong section not sure
    As you could have seen from the output on the console, your javac.exe was successfully found. Javac couldn't find your Hello.java file (as it wrote).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,619
    Rep Power
    23

    Default

    Use the dir command at the command prompt to see what files are in the current directory.

  4. #4
    waao is offline Member
    Join Date
    Aug 2011
    Posts
    7
    Rep Power
    0

    Default

    But i dont udnerstand why it oculdnt find it as i saved is as Hello.java on desktop

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,619
    Rep Power
    23

    Default

    Your were not on the desktop when you did this command:

    C:\Users\Havard>javac Hello.java

    Move Hello.java to the Havard folder and try again.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,023
    Blog Entries
    7
    Rep Power
    20

    Default

    I bet your desktop isn't named 'Havard' ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    Joel's Avatar
    Joel is offline Member
    Join Date
    May 2011
    Location
    Placerville, CA
    Posts
    86
    Rep Power
    0

    Default

    If Hello.java is on the desktop you need to go to \Users\Desktop. Then run. Don't work? Reboot. Rebooting is always the elixir. Come on, you go to Havard University. <winks>
    ~MSP430 Lover~

  8. #8
    waao is offline Member
    Join Date
    Aug 2011
    Posts
    7
    Rep Power
    0

    Default

    :s stipud me hehe got it now forgot wasn't on desktop when i typed the command...

    Thanks for all help

Similar Threads

  1. Javac, file not found
    By Zorobay in forum New To Java
    Replies: 1
    Last Post: 02-15-2010, 11:30 AM
  2. error while compile code using javac
    By suri in forum New To Java
    Replies: 3
    Last Post: 01-20-2010, 09:10 AM
  3. javac:file not found
    By lovearora in forum New To Java
    Replies: 3
    Last Post: 02-09-2009, 03:20 AM
  4. javac file not found
    By teamkeff in forum New To Java
    Replies: 6
    Last Post: 06-23-2008, 10:17 PM
  5. source code of 'javac'?
    By Pooja Deshpande in forum Advanced Java
    Replies: 2
    Last Post: 06-04-2008, 11:24 AM

Posting Permissions

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