Jruby require 'java' gives warning

In JRuby 1.2.0 (haven't checked other versions), require 'java'; gives a
warning that there is no such file to load.

Generally, the jruby rails environment does this for you, or some other
library pulls it in, but in a bare script you need to do it yourself.

In any case, it should not be a warning.

0
2 comments

Hello Charles,

Are you using RubyMine or the Ruby plugin?

RubyMine does not know, and is not going to know, anything about require
'java' or other JRuby-specific extensions. All of them are fully supported
only in the Ruby plugin.

In JRuby 1.2.0 (haven't checked other versions), require 'java'; gives
a warning that there is no such file to load.

Generally, the jruby rails environment does this for you, or some
other library pulls it in, but in a bare script you need to do it
yourself.

In any case, it should not be a warning.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Avatar
Permanently deleted user

I'm using RubyMine for a standalone JRuby project.


The libs in question are in
JRUBY_HOME/lib/ruby/site_ruby/1.8/builtin/javasupport

I was able to workaround it my explicitly putting it on my loadpath, but
it seems like if you know that a project is using JRuby SDK, then it
putting that directory on the loadpath is doable, since it is bundled
with JRuby.

In any case, I just explicity put it in the loadpath of the project as a
workaround.

cheers,
Charles


Dmitry Jemerov wrote:

Hello Charles,

Are you using RubyMine or the Ruby plugin?

RubyMine does not know, and is not going to know, anything about require
'java' or other JRuby-specific extensions. All of them are fully
supported only in the Ruby plugin.

>> In JRuby 1.2.0 (haven't checked other versions), require 'java'; gives
>> a warning that there is no such file to load.
>>
>> Generally, the jruby rails environment does this for you, or some
>> other library pulls it in, but in a bare script you need to do it
>> yourself.
>>
>> In any case, it should not be a warning.

0

Please sign in to leave a comment.