In Java I need to find out the location where the software is executed ( the jar file).
I use:
URL uri = Log.class.getProtectionDomain().getCodeSource().getLocation().toURI();
File file = new File(uri);
This works fine, but in some corporate environments with Windows + Citrix Clients the URI is like:
\winnasredir$W2K12_UserDataIWEREQSMy DocumentsDbSchema
and the constructor new File(uri) fails with IllegalArgumentException(“URI has an authority component”)
Which is the best work around for this?
I need a File object pointing to the current software location.