ok capito:
così sembra funzionare anche sotto windows.codice:public String jarPath() throws UnsupportedEncodingException { String pathJar = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); int p = pathJar.lastIndexOf(":"); int s = pathJar.lastIndexOf("/"); String path = pathJar.substring(p + 1, s + 1); return path; }
grazie!

Rispondi quotando