Ok, I did not find the 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); }
This copy correctly copies the file and correctly deletes the original only when running linux.
I think that for this I need to call the class using the class loader.
selan source share