This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I have created a package by name "m" in a directory c:\myjava with the directory name m. I have created a file in c: directory which is importing the package m by name test.java. when i try to compile test.java...it's giving error can't find package m. I have set the path environmental variable to c:\myjava
As mentioned above, you need to set the CLASSPATH environment variable instead of PATH. The difference is that the operating system uses PATH to find programs it can execute from the command line. Including the Java installation directory in the PATH environment variable allows you to just type "java" and "javac" instead of the full path to these programs. On the other hand, Java itself uses the CLASSPATH variable to find classes. This means that the CLASSPATH should include the c:\myjava directory but PATH shouldn't.
I hope this helps. Please come back for futher clarifications if you need them.