Closed Solved

[JAVA HELP] Help with javac

Im an absolute beginner to Java and im learning from
Beginning Java by Ivor Horton

I installed JDK 7 and did change the path variable to point to the bin directory in the root folder.
however when i issue this command from cmd, I get this error
Command: javac MyProgram.java
Error: file not found.

Now this is not posible cause I have checked that the file is there.
The same thing seems to work fine with Jcreator LE.

So my two questions are:
1. How do I resolve this javac error?
2. If I want to save all my source codes to another directory (lets assume a directory named SourceCode on Desktop) then what changes have to be made???

ps: Im an absolute noob.
4 answers Last reply Best Answer
More about java help javac
  1. Path : C:\Program Files\Java\jdk1.7.0_04\bin\
  2. Best answer
    Are you issuing that command from the directory where MyProgram.java is? If you don't specify a path but just a filename, Windows looks for it in the current working directory. Remember that you'll have to use the cd command to navigate to the directory with the file before running it, or specify the absolute or relative path to the file from the default working directory (which is C:\Users\%USERNAME%).
  3. Best answer selected by fasihxkhatib.
  4. This topic has been closed by Area51reopened
Ask a new question

Read More

Programming Java Command Prompt Apps