I have created a java program and prevented the class file to be saved in package where source file is saved say pracjava by using these steps: include the package abc like that package abc; in program and then compling the prog in this way e:\pracjava\javac -d . prog.java this creating class file inside abc package which is inside pracjava package but when i am executing program using e:\pracjava\java prog then it is not running giving error no classdef found error i have set path to c:\jdk1.5\bin and classpath to e:\pracjava however when compling the program using e:\pracjava\javac prog.java and then executing it. It is not giving any error
The filename has to be the same as the class/package name, like if your classname is ABC, the filename has to be ABC.java!
name of class file is prog not abc. abc name of subpackage that created by command javac -d . prog.java