Sunday, May 2, 2010

Find the classpath

1) ProtectionDomain protectionDomain = Test.class.getProtectionDomain();
URL location = protectionDomain.getCodeSource().getLocation();
System.out.println(location);

OR

2) System.out.println(Test.class.getResource("Test.class"));

No comments:

Post a Comment