javac is unable to recognize classpath in win2000.
I tried setting classpath with no success.
Could this have anything to do with the several hotfixes from Microsoft? reason is this wayback this OS without the most recent service pack work well on another machine. Please help what am i doing wrong?
I did the same j2sdk1.4.2_06 installation on two machines with similar OS with the same results. I even tried compile helloworldapp.java thinking it could be my javawsourceCode with similar results.
However helloworldapp.java did compile if I change to the directory path and compile. But my MainSourceCode.java which call external class will not compile. (See errors below.)
I force classpath setting using Set classpath @ command prompt also set classpath at mycomputer properties, even using Javac -classpath to set classpath. No success.
Here are the errors: @ c:\ Javac helloworldapp.java error: cannot read: helloworldapp.java 1 error
If I were able to compile withing the source directory I would be contented but I am unable to compile source code that requires calling other external classes though they reside in the same directory.
classpath on NT and Unix like systems (which includes Win2000) does not by default include the current directory. Add ;. at the end of your classpath.
To be able to compile from anywhere check the javac help, it should tell you that you can include a commandline option -sourcepath <path> and -d <path> to tell the compiler where to read sources and write compiled classfiles.
Jeroen points out something very important, but doesn't necessarily state it directly enough:
You seem to be assuming that javac uses CLASSPATH to find *.java files. That's wrong -- it does not. It only uses CLASSPATH to find *.class files. There is a command-line -sourcepath option you can use, or (as I believe is far, far more common) you can compile from the directory where the source is located.
As far as the syntax error in MainSourceCode.java: that has nothing to do with the classpath -- your code needs fixing.
So to say this all again: from your description, it appears that everything is working as its supposed to. [ October 14, 2004: Message edited by: Ernest Friedman-Hill ]