A few points: 1. You do not need the import statement because both classes are in the same package. 2. You should use all lowercase letters for path names (and directories). For example: mubeen.java.dan 3. If you do not want c:\ in your classpath you must CD to c:\ first before doing the abovementioned java command. 4. It would be a good idea to make class TestPack public if it contains your main method.