Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default javac: file not found Error

    Hi,

    I'm recently learning java for a few different reasons. I'm comfortable - though not advanced by any means - using C and C++ for simple things, and if you gave my a program written entirely in either of those, I could explain to you what most of the components are doing. I would like to get to that same point with java. Anyways, I'm using this as one of my first little tutorials into java...

    Building an Application: Introduction

    And it was going well. I think I get most of what is going on. (Time will tell, right?). Anyways, I reached the last page, where it instructs me to compile the .java file I've created. When I go to do so, I get this error:

    javac: file not found: DiveLog.java
    Usage: javac <options> <source files>
    use -help for a list of possible options

    I have been reading quite a few threads on this, and have tried basically everything suggested. No progress so far. I have, for my sanity's sake, written a HelloWorld.java file, and that compiled fine, so I don't believe it's a problem with my environment variables or anything like that. So...Is there more likely a problem with the contents of the DiveLog.java file? I'm willing to try anything (even if it's something I've already done). Any help would be much appreciated!

    Lastly, if you're wondering, I'm just using notepad. I appreciate what some programs can do for making code easier to understand and use, but I prefer learning code in its most basic form :)

    Cheers!
    Limbless

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

    Default

    If your current directory is the directory where you think your file is stored there are a few options: the file isn't there or the file is named something else (e.g. divelog.java or even DiveLog.java.txt). Open up a shell (cmd), go to that directory and do a 'dir' and see for yourself.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    *Jaw hits the floor* Thanks so much! I guess I shouldn't be coding at 5 am. Here I was getting way in over my head messing with all the different paths, running things from all over my computer...The file was just still calling itself DiveLog.java.txt For whatever reason it wasn't mentioning that when I went to rename it. So, problem solved. Always right under your nose...Now I have 36 errors - AH! - to wade through.

    Again thanks!

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

    Default

    It's notepad; it thinks it knows better and adds a .txt extension to the file name even if it has an extension already. Stupid thing ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. javac: file not found:
    By Tastosis in forum New To Java
    Replies: 6
    Last Post: 03-24-2011, 06:35 AM
  2. Javac, file not found
    By Zorobay in forum New To Java
    Replies: 1
    Last Post: 02-15-2010, 12:30 PM
  3. compilation problem "javac:file not found..."
    By Faruq in forum New To Java
    Replies: 9
    Last Post: 02-02-2010, 07:35 PM
  4. javac:file not found
    By lovearora in forum New To Java
    Replies: 3
    Last Post: 02-09-2009, 04:20 AM
  5. javac file not found
    By teamkeff in forum New To Java
    Replies: 6
    Last Post: 06-23-2008, 11:17 PM

Posting Permissions

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