Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Fonte Link

Tente desta forma, conforme resposta no SOEnresposta no SOEn:

String jarName = new java.io.File(SomeClassInYourJar.class.getProtectionDomain()
      .getCodeSource()
      .getLocation()
      .toURI()
      .getPath())
      .getName();

Tente desta forma, conforme resposta no SOEn:

String jarName = new java.io.File(SomeClassInYourJar.class.getProtectionDomain()
      .getCodeSource()
      .getLocation()
      .toURI()
      .getPath())
      .getName();

Tente desta forma, conforme resposta no SOEn:

String jarName = new java.io.File(SomeClassInYourJar.class.getProtectionDomain()
      .getCodeSource()
      .getLocation()
      .toURI()
      .getPath())
      .getName();
Fonte Link
user28595
user28595

Tente desta forma, conforme resposta no SOEn:

String jarName = new java.io.File(SomeClassInYourJar.class.getProtectionDomain()
      .getCodeSource()
      .getLocation()
      .toURI()
      .getPath())
      .getName();