获取桌面路径
File desktopDir = FileSystemView.getFileSystemView() .getHomeDirectory(); String desktopPath = desktopDir.getAbsolutePath()+"/";
获取根目录
System.getProperty("user.home")
File desktopDir = FileSystemView.getFileSystemView() .getHomeDirectory(); String desktopPath = desktopDir.getAbsolutePath()+"/";
System.getProperty("user.home")