<aryehhillman>
Hi — I've had a really difficult time resolving this error:
<aryehhillman>
`(LoadError) load error: psych -- java.lang.NoClassDefFoundError: Could not initialize class org.jruby.ext.psych.PsychEmitter
<aryehhillman>
org.jruby.embed.EvalFailedException: (LoadError) load error: psych -- java.lang.NoClassDefFoundError: Could not initialize class org.jruby.ext.psych.PsychEmitter`
<aryehhillman>
Unfortunately I don't have a simple repro but have a few observations:
<aryehhillman>
I am running JRubv 1.9.17 and when I run `irb` and set `GEM_PATH` on the command line and run `require 'psych'` things are great
<aryehhillman>
When I add JRuby to a gradle file and use `runScriptlet` with `require 'pscyh'` (being sure to set GEM_HOME in the script just like from irb) I get the error aboe.
<aryehhillman>
* above.
<aryehhillman>
It doesn't look so much like a Ruby issue, per sé, as an issue with setting up environment that I'm not doing right.
<aryehhillman>
If anyone has any guidance, please let me know... I'll check back later in case any one might have any ideas of how to debug.
<aryehhillman>
Only mentioning the `GEM_HOME` thing as to show that `psych` is being `required` using the same search paths as IRB (i.e. same version)
<headius[m]>
enebo: that's a template for how we can do access to these packages without triggering warnings
<headius[m]>
have a look
<headius[m]>
The key there is that all the core Java packages always appear to be open to the unnamed module (normal classpath) but they will still warn if you access them. I discovered that if we explicitly addOpens the warning goes away
<headius[m]>
addOpens will fail if it's not actually open so that's where we fall back
ur5us has joined #jruby
aryehhillman has quit [Quit: Lost terminal]
ur5us has quit [Ping timeout: 240 seconds]
<headius[m]>
kares: you probably are interested in this too