Sign in with
Sign up | Sign in
Your question
Closed

[JAVA HELP] Help with javac

Last response: in Apps General Discussion
Share
April 28, 2012 5:22:53 AM

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.

More about : java help javac

April 28, 2012 5:25:40 AM

Path : C:\Program Files\Java\jdk1.7.0_04\bin\
Score
0

Best solution

a b L Programming
April 29, 2012 4:09:27 AM

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%).
Share
Related resources
May 6, 2012 1:28:24 PM

Best answer selected by fasihxkhatib.
Score
0
May 6, 2012 1:31:57 PM

This topic has been closed by Area51reopened
Score
0
!