URL url = getClass().getProtectionDomain().getCodeSource().getLocation(); String path = URLDecoder.decode(url.getPath(), "utf-8"); //important: if directory has space or chinese words File file= new File(path); System.out.println("directory is: " + file.getPath());
No comments:
Post a Comment