Skip to content

Avoid passing bogus -classpath when empty#9272

Merged
headius merged 3 commits intojruby:jruby-10.0from
headius:jruby.sh_no_bogus_classpath
Mar 1, 2026
Merged

Avoid passing bogus -classpath when empty#9272
headius merged 3 commits intojruby:jruby-10.0from
headius:jruby.sh_no_bogus_classpath

Conversation

@headius
Copy link
Member

@headius headius commented Feb 28, 2026

If no CLASSPATH env is provided when running jruby.sh, we end up building a bogus classpath flag of -classpath :. Other situations may result in forms like -classpath some.jar: or -classpath :some.jar. The changes here avoid passing -classpath at all if empty, and only insert delimiters when concatenating classpaths if they are non-empty.

Possible fix for #9255

@headius headius requested a review from mrnoname1000 February 28, 2026 01:38
If no CLASSPATH env is provided when running jruby.sh, we end up
building a bogus classpath flag of `-classpath :`. Other situations
may result in forms like `-classpath some.jar:` or
`-classpath :some.jar`. The changes here avoid passing -classpath
at all if empty, and only insert delimiters when concatenating
classpaths if they are non-empty.

Possible fix for jruby#9255
@headius headius force-pushed the jruby.sh_no_bogus_classpath branch from 81d4d64 to 14dea60 Compare February 28, 2026 02:06
@headius
Copy link
Member Author

headius commented Feb 28, 2026

@mrnoname1000 This appears to work fine but it's a little redundant in places. Maybe you have a suggestion to clean it up?

@headius headius added this to the JRuby 10.0.4.0 milestone Feb 28, 2026
@headius
Copy link
Member Author

headius commented Feb 28, 2026

Marked for 10.0.4.0 but probably should be backported to 9.4 (at least until we can make it upgradable after release).

@mrnoname1000
Copy link
Contributor

@headius I rearranged the logic to be a little simpler, opened a PR into this one here: headius#7

@headius headius changed the base branch from master to jruby-10.0 March 1, 2026 21:00
@headius
Copy link
Member Author

headius commented Mar 1, 2026

@mrnoname1000 Thank you!

@headius headius merged commit 0fd67cc into jruby:jruby-10.0 Mar 1, 2026
77 of 78 checks passed
@headius headius deleted the jruby.sh_no_bogus_classpath branch March 1, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants