Discussion:
[jruby-user] A Question About java_import
Michael Chapman
2014-06-08 17:54:38 UTC
Permalink
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.
--
Posted via http://www.ruby-forum.com/.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Alex Tambellini
2014-06-08 18:17:57 UTC
Permalink
My guess is this line of code:

https://github.com/jruby/jruby/blob/master/core/src/main/ruby/jruby/java/core_ext/kernel.rb#L3

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.
Post by Michael Chapman
Does anyone know why I sometimes need to use quotations when using
java_import?
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
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.
--
Posted via http://www.ruby-forum.com/.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Michael Chapman
2014-06-09 00:14:25 UTC
Permalink
Ahh, thanks. That makes a lot of sense.
--
Posted via http://www.ruby-forum.com/.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Loading...