Add an error for running jruby.sh from a broken JRUBY_HOME#9217
Merged
headius merged 1 commit intojruby:masterfrom Feb 6, 2026
Merged
Add an error for running jruby.sh from a broken JRUBY_HOME#9217headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
If bin/jruby.sh is located within a JRUBY_HOME that is incomplete (such as a freshly-checked-out repository) it will fail when it tries to access an unset JRUBY_CP variable. This patch detects the missing lib/jruby.jar and terminates the script early rather than letting it fail with a cryptic shell error. See jruby#9216
Member
Author
|
Ping @mrnoname1000 for a review. |
mrnoname1000
approved these changes
Feb 6, 2026
Contributor
mrnoname1000
left a comment
There was a problem hiding this comment.
Looks like a good change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #9216 @eregon reported that JRuby was failing to run specs with an error about unbound variable
JRUBY_CP. This variable can only be left unset if thebin/jruby.shbeing executed is not accompanied by a siblinglib/jruby.jar, as might happen when running from a fresh repository clone.The issue in #9216 was that for some reason, subprocesses launching
rubywere choosing the bin scripts from a fresh JRuby clone rather than the one inPATHassociated with a fully-functional JRuby.This configuration is unsupported;
bin/jruby.shuses relative pathing to find its associatedlib/jruby.jar, and if it is not present there's no way to proceed with execution. But the error message provided is cryptic and does not help a user debug the issue.This path adds a check for the missing jar and terminates early with the following error message (negotiable):