In Java such task is not straight forward to accomplish, so I'm posting here a snippet that will return the full path of the class location.
import java.security.CodeSource;
import java.security.ProtectionDomain;
public class Utilities {
protected static final String getApplicationLocation() {
final ProtectionDomain pd = Utilities.class.getProtectionDomain();
final CodeSource cs = pd.getCodeSource();
return cs.getLocation().getPath().replaceFirst("/", "");
}
}
./M6