Skip to content

Ensure we have a classloader to boot from#9298

Merged
headius merged 2 commits intojruby:masterfrom
headius:ensure_boot_classloader
Mar 10, 2026
Merged

Ensure we have a classloader to boot from#9298
headius merged 2 commits intojruby:masterfrom
headius:ensure_boot_classloader

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented Mar 10, 2026

If JRuby is loaded in the bootstrap classloader, the direct getClassLoader for a Class object might return null. Use the alternative Ruby.getClassLoader instead which will fall back on the standard system classloader.

@headius headius added this to the JRuby 10.1.0.0 milestone Mar 10, 2026
@headius headius force-pushed the ensure_boot_classloader branch from 3b50823 to 50aee23 Compare March 10, 2026 19:19
headius added 2 commits March 10, 2026 14:49
If JRuby is loaded in the bootstrap classloader, the direct
getClassLoader for a Class object might return null. Use the
alternative Ruby.getClassLoader instead which will fall back on
the standard system classloader.
This adds a simpler path for classloader-based loading of files
when we just want to get the system classloader resources shipped
with JRuby. This will reduce the chance of someone using an
improper classloader (e.g. JRubyLibrary might have loaded the wrong
file from a JRubyClassLoader rather than the one shipped with
JRuby) or stumbling on to a null classloader (as sometimes happened
to the loads from javasupport.Java when running in a bootstrap
classloader).
@headius headius force-pushed the ensure_boot_classloader branch from 50aee23 to 45189cb Compare March 10, 2026 19:49
@headius headius enabled auto-merge March 10, 2026 20:39
@headius headius disabled auto-merge March 10, 2026 20:39
@headius headius merged commit c25d71e into jruby:master Mar 10, 2026
136 of 160 checks passed
@headius headius deleted the ensure_boot_classloader branch March 10, 2026 20:39
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.

1 participant