Load the class source location from Class.getResource()
publicclass Main {
publicstaticvoid main(String args[]) {
Class theClass = Main.class;
java.net.URL u = theClass.getResource("");
System.out.println("This class (FromWhere) is located at : " + u);
}
}