Cannot read file/stopped compiling

Hello,

Yesterday I posted a question, how can I get my program to run.It was suggested that I set up my classpath to the exact directory that I have my .class files which I did. c:\javafiles\This worked. Before I figured it out I redid my path. Well after running the Saluton program I went back to compile my root.java source file and guess what I got the message

cannot read root.java

error 1

Sooooo!!! Now I can run a program but cannot compile my new ones.

I have changed my path so many times I don't know what it should be.

my jdk is c:\jdk1.3.1_01\bin

should I have class and/or tools.jar in the path also or maybe even javafiles directory in the path and not just the classpath.

c:\javafiles is the directory where I place my programs.

Another question which may sound very stupid, but what is the difference between the path and the classpath and should they be set up the same.

[971 byte] By [ANGELEFEVANS] at [2007-9-26 8:30:29]
# 1

The Path setting is how DOS finds files. When you enter a command in DOS like "javac root.java" DOS tries to find an .exe, .bat, etc. file to execute, in this case javac.exe. It looks in the current directory (if I remember right) and if it doesn't find it there, looks in the directories that are in the Path setting.

The Classpath setting is how java finds classes. When you reference a class in your source code, "import root;" for example, the javac compiler will search for the root class by looking in the directories in the Classpath. (Also, jar files can be in the Classpath and built-in classes don't need to be in the Classpath in recent versions of java.)

If you have a DOS error - for example "bad command or file name" - it means a path problem. If you have the java error "NoClassDefFound" then it's probably a Classpath problem.

"cannot read root.java" is a javac error. It means the file root.java isn't in the current directory. This error can not be fixed with Path or Classpath. Either CD to the directory where root.java exists or give the path to root.java in the javac command.

atmguy at 2007-7-1 19:10:18 > top of Java-index,Developer Tools,Java Compiler...