Your original question was not totally clear (since it did not contain the complete error message).
From your comment:
$ javac Example1.java
javac: file not found: Example1.java
Usage: javac <options> <source files> use -help for a list of possible options
So, javac did not find your file example java.
Normally, you should not have to set the CLASSPATH (use export CLASSPATH= in bash), and javac would search the source in the current directory. Is your Example1.java in the current directory? (Type ls and look at the output.)
If not, you should give the path to this file to javac as a parameter ... but it really is better so simply move to the right directory with cd.
If you are using packages, position your shell to the directory on top of the package directory hierarchy, and call the compiler with the relative filename from there.
Edit, since I see the next questions coming:
- The compiler will put the resulting class files in the output directory tree given by the
-d parameter (or the current directory, if not given), by their package structure, so make sure you search them there later (when invoking the program).
If the compiler needs other classes to compiler the files indicated in the command line, it searches class files in the classpath (given by the -classpath or -cp option, or by the CLASSPATH environment variable, or the current directory) and source files in the sourcepath (given by the -sourcepath option or the classpath if no sourcepath is set). If for a needed both exist and the source file is newer, it is recompiled too. (They are searched according to the package-structure, too.)
So in this case you should make sure to pass the -sourcepath option so the compiler can find your other source files.