Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javac ignores CLASSPATH

843804Oct 15 2001 — edited Oct 20 2001
Hi everybody,

I am new to Java and currently I have a problem compiling my source files. I set the CLASSPATH to the directory in which my source files are stored, but it seems that jdk1.3.1 ignores the CLASSPATH.
Example:

My CLASSPATH is: F:\javaprojects;.
My PATH is: F:\jdk1.3.1_01\bin;.
My source file: F:\javaprojects\HelloWorld.java

The following error occurs:

C:\>javac HelloWorld.java
error: cannot read: HelloWorld.java
1 error

What does this mean? When I am changing my current directory to F:\javaprojects no error occurs and I am able to run the program:

F:\javaprojects>javac HelloWorld.java

F:\javaprojects>java HelloWorld
Hello World

Did I set a wrong CLASSPATH? Or has the current directory always to be the same as the directory in which my source files are stored? Somebody knows a solution?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2001
Added on Oct 15 2001
4 comments
396 views