It sounds weird, and it is:

String jarDir = FileSystem.class.getProtectionDomain().getCodeSource().getLocation().getPath();