更新时间:2023-01-31 16:37:06
好的,我没有找到完美的解决方案,但有些东西......
Ok, I don't found a perfect solution but something...
try {
//Files.move(fileToBeInstalled.toPath(), installPathFile.toPath(), REPLACE_EXISTING);
Files.copy(fileToBeInstalled.toPath(), installPathFile.toPath(), REPLACE_EXISTING);
fileToBeInstalled.delete();
} catch (IOException ex) {
MainClass.getMainClass(InstallerLinux.class.getName()).log(Level.SEVERE, null, ex);
}
此文件正确复制并仅在 linux 执行时正确擦除原始文件.
This copy correctly the file and erases correctly the original only on linux execution.
我认为要做到这一点,我需要使用类加载器调用该类..
I think for do that I need to invoke the class using a class loader..