请帮助我想获取运行jar的根文件夹。
D:\My Folder\My Folder1\ myjarfile
D:\My Folder\My Folder1\My Folder2
我想使用myjarfile在MyFolder2中保存图像。我在编写可执行jar的路径时遇到了困难:
String savePath = what goes there?(i want this "D:\My Folder\My Folder1\My Folder2")
ImageIO.write(image1, "png",new File(savePath));
答案 0 :(得分:3)