You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently installed JRuby 9.3.1.0 using ruby-build. The ruby-build recipe will install the jruby-launcher gem, which will replace bin/jruby in the distribution. When I try to run JRuby, I see the following error:
execv failed: Permission denied (13)
If I fetch the JRuby tarball and run it locally with the original bin/jruby, everything works. I've narrowed the issue down to the replaced launcher from jruby-launcher. Moreover, I've discovered I only get the failure when the JAVA_HOME env var is not set. With other Java applications, that isn't an issue as java is available on the PATH.
Currently, my java command is coming from Homebrew for Linux:
Debugging this with @headius, it looks like there are two errors. First, my /usr/bin/java, through a chain of symlinks, points at a JVM directory rather than the binary. This appears to be a misuse of Ubuntu's update-alternatives command. I hadn't caught it because java gets picked up in a later PATH entry when working in my shell. The second issue is the launcher, while iterating through PATH entries, finds the bad /usr/bin/java value and assumes it's an executable file and stops searching at that point. Thus, the resolution logic ends up being different from the shell.
I'll fix this on my machine, but it's probably worth making the launcher a bit more resilient. If nothing else, it could present the user with a neater error message.
The simple fix will be to check that the java command we find in PATH actually resolves to an executable file rather than a directory. I believe that will resolve this for @nirvdrum and any future users with peculiar java dirs in their PATH.
I recently installed JRuby 9.3.1.0 using ruby-build. The ruby-build recipe will install the jruby-launcher gem, which will replace bin/jruby in the distribution. When I try to run JRuby, I see the following error:
If I fetch the JRuby tarball and run it locally with the original bin/jruby, everything works. I've narrowed the issue down to the replaced launcher from jruby-launcher. Moreover, I've discovered I only get the failure when the
JAVA_HOME
env var is not set. With other Java applications, that isn't an issue asjava
is available on thePATH
.Currently, my
java
command is coming from Homebrew for Linux:If I set my
JAVA_HOME
env var to/home/linuxbrew/.linuxbrew/Cellar/openjdk/17
the launcher begins working.Here is the strace output when trying to start the launcher:
This looks like a similar situation to #31.
The text was updated successfully, but these errors were encountered: