getdown
getdown copied to clipboard
Custom JVM installation does not work with relative appdir
My getdown.txt looks like this:
appbase = http://localhost:8081/test
code = helloworld.jar
class = HelloWorld
java_min_version = 9999999
java_location = [linux] /jvm/java_linux.jar
When running getdown with an absolute appdir (e.g. java -jar test/getdown.jar /path/to/test
) it works, but when running with a relative appdir (e.g. java -jar test/getdown.jar test
) it doesn't.
Excerpt from launcher.log:
2015/03/24 17:22:37:937 WARNING m.a: launch() failed.
java.io.IOException: Cannot run program "test/java_vm/bin/java" (in directory "test"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at com.threerings.getdown.data.Application.createProcess(Unknown Source)
at com.threerings.getdown.launcher.Getdown.launch(Unknown Source)
at com.threerings.getdown.launcher.Getdown.getdown(Unknown Source)
at com.threerings.getdown.launcher.Getdown.run(Unknown Source)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 5 more
The problem is that (at least on my Linux system) the program path should be relative to the working dir of the subprocess, which is the appdir (see https://github.com/threerings/getdown/blob/2225ae6e97c9ba60b6f37655bddad60f4f573a43/src/main/java/com/threerings/getdown/data/Application.java#L991), but currently the appdir is also prepended to the program path (https://github.com/threerings/getdown/blob/2225ae6e97c9ba60b6f37655bddad60f4f573a43/src/main/java/com/threerings/getdown/util/LaunchUtil.java#L96).