Results 1 to 6 of 6

Thread: Question on Programming with Java

  1. #1

    Default Question on Programming with Java

    One small question. I seem to be having technical difficulties when trying to compile my java program. The course study book I am using says to use the comman "javac (file name)" to compile my .java file. However when I type in the said command, windows command prompt replies "error: cannot read file". I do not know what is wrong. I have the paths defined, as far as I know and the file extensions are correct. I just don't understand why it will not read the file. I'm using Notepad to input the code and Windows Command Prompt to execute the J2SE SDK v1.4.2 javac program. I thought I might be missing a few java files, but I am not sure. There is no troubleshooting section of this book. I don't know how much help I will receive here, but any I would appreciate. Thanks.

    ~LionHart~
    ~LionHart~

  2. #2
    Ominous Wanderer Tech Admin Samuraid's Avatar
    Join Date
    Oct 2001
    Posts
    5,522

    Default

    Try explicitly specifying all input paths. Like...

    c:\whatever\java\path\javac c:\whatever\program\path\YourProgram.java

  3. #3

    Default

    Nope . It didn't work. Thanks for your help though.
    ~LionHart~

  4. #4
    Ominous Wanderer Tech Admin Samuraid's Avatar
    Join Date
    Oct 2001
    Posts
    5,522

    Default

    Can you attach a copy of the java file you are trying to compile with javac?

  5. #5

    Default

    I figured it out. Truth is, I don't know anything about this stuff yet and I wasn't even in the right directory. Defining the paths would have fixed the problem, however, I didn't know how to do that right. It's all good now. I'm advancing...sort of. Thanks for your help.
    ~LionHart~

  6. #6
    Ominous Wanderer Tech Admin Samuraid's Avatar
    Join Date
    Oct 2001
    Posts
    5,522

    Default

    Glad you got it figured out.

Posting Permissions

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