What's your CLASSPATH
value?
It may look like this:
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
I guess your value does not contain this .;
.
So, ADD IT .
When you done , restart CMD
That may works.
For example the file HelloWorld.java
is in path: D:\myjavatest\org\yz\test
and its package
is: org.yz.test
.
Now, you're in path D:\myjavatest\
on the CMD line.
Type this to compile it:
javac org/yz/test/HelloWorld.java
Then, type this to run it:
java org.yz.test.HelloWorld
You may get what you want.