I ran this test class with JDK1.4_02
import java.security.CodeSource;
import java.security.ProtectionDomain;
public class TestLocation
{
public TestLocation(){
System.out.println("This is the sample constructor");
}
public static void main(String args[]){
try{
System.out.println("Code ----Location---" +
Class.forName("TestLocation").getProtectionDomain().getCodeSource().getLocation(\
));
}catch(ClassNotFoundException e){
System.out.println("---The exception " + e);
}
}
}
and the output was
Code ----Location---file:/D:/JDev905/jdev/mywork/Test/Java/classes/