Commit 5301a57
committed
Set executable bit in a less fragile way
On my Ubuntu 24.04 system, I was seeing:
[ERROR] java.io.IOException: Cannot run program "chmod": error=13, Permission denied
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
at java.base/java.lang.Runtime.exec(Runtime.java:681)
at java.base/java.lang.Runtime.exec(Runtime.java:530)
at net.imagej.updater.Installer.verify(Installer.java:389)
at net.imagej.updater.Installer$VerifyFiles.itemDone(Installer.java:333)
at net.imagej.updater.util.AbstractProgressable.itemDone(AbstractProgressable.java:87)
at net.imagej.updater.util.Downloader.download(Downloader.java:130)
at net.imagej.updater.util.Downloader.start(Downloader.java:90)
at net.imagej.updater.Installer.start(Installer.java:217)
at net.imagej.ui.swing.updater.UpdaterFrame.install(UpdaterFrame.java:596)
at net.imagej.ui.swing.updater.UpdaterFrame$5.run(UpdaterFrame.java:534)
Caused by: java.io.IOException: error=13, Permission denied
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
... 11 more
Why? I have no idea. But using the setExecutable method instead works.1 parent bcdbc37 commit 5301a57
File tree
2 files changed
+4
-7
lines changed- src/main/java/net/imagej/updater
2 files changed
+4
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
493 | | - | |
494 | | - | |
| 492 | + | |
| 493 | + | |
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 388 | + | |
| 389 | + | |
392 | 390 | | |
393 | 391 | | |
394 | 392 | | |
| |||
0 commit comments