public class Main {
public static void main(String[] args) {
Main csl = new Main();
csl.getCodeSourceLocation();
}
private void getCodeSourceLocation() {
System.out.println("Code source location: "
+ getClass().getProtectionDomain().getCodeSource().getLocation());
}
}