If 'jruby' executable is a relative symlink, JRuby won't start
--------------------------------------------------------------
Key: JRUBY-3318
URL: http://jira.codehaus.org/browse/JRUBY-3318
Project: JRuby
Issue Type: Bug
Components: Miscellaneous
Affects Versions: JRuby 1.1.6
Environment: Mac OS X 10.5.6, but likely affects all Un*x-derived
platforms
Reporter: Andrew Geweke
Priority: Minor
If the 'jruby' executable in your PATH is actually a symlink with a relative
(not absolute) path to the real 'jruby' shell script, then the real 'jruby'
shell script calculates JRUBY_HOME incorrectly and JRuby will, in general,
refuse to start. (It incorrectly treats the symlink as relative to the current
directory; relative symlinks are of course relative to the directory that
they're in.)
Because the 'jruby' shell script ignores any setting of JRUBY_HOME in your
environment, it does not seem possible to override this.
Steps to reproduce -- apologies; I couldn't see any place to put this kind of
test in the test suite:
(make sure there is no 'jruby' in your PATH)
tar zxf jruby-1.1.6-bin.tar.gz
mkdir mylink && cd mylink
ln -s ../jruby-1.1.6/bin/jruby .
cd ..
mylink/jruby -e 'puts "hello, world"'
--> Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/Main
The attached patch corrects this issue; it checks to see if the symlink is
relative, and, if so, prepends the directory that the symlink is in.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email