Forum: JRuby A Question About java_import

F4a55256d7dbb04f2a0287c1c64b38ea?d=identicon&s=25 Michael Chapman (kabbotta)
on 2014-06-08 19:54
Does anyone know why I sometimes need to use quotations when using
java_import?

For instance, this works fine:

    java_import com.badlogic.gdx.Gdx

But if I try and use this,

    java_import box2dLight.RayHandler

it tells me it can't find the library. But it works fine if I add the
quotes:

    java_import 'box2dLight.RayHandler'

Is there something missing from the setup of the .jar? It's not a big
deal, but I have no idea what's going on.
302c6c56b99912a673f1213b0709c902?d=identicon&s=25 Alex Tambellini (Guest)
on 2014-06-08 20:18
(Received via mailing list)
My guess is this line of code:

https://github.com/jruby/jruby/blob/master/core/sr...

So packages that start with java, javax, javafx, com, and org will work
without quotes, but for any other packages you will need to quote.
F4a55256d7dbb04f2a0287c1c64b38ea?d=identicon&s=25 Michael Chapman (kabbotta)
on 2014-06-09 02:14
Ahh, thanks. That makes a lot of sense.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.