Issue requiring third party jars
--------------------------------

                 Key: JRUBY-1039
                 URL: http://jira.codehaus.org/browse/JRUBY-1039
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.0.0RC2
         Environment: Tried this on Windows XP and Fedora linux, JRuby 1.0.0RC2 
binary dist.
            Reporter: Mike McKinney
            Assignee: Thomas E Enebo


Downloaded 1.0.0RC2 from dist site, exploded, set JRUBY_HOME to install 
directory, updated PATH for JRUBY_HOME/bin.

I'm trying the JNA sample integration for Jruby (https://jna.dev.java.net/).  I 
put the jna.jar file in JRUBY_HOME/lib, fired up jirb and tried the following:

irb(main):001:0> require 'java'
=> true
irb(main):002:0> N = com.sun.jna.NativeLibrary
NameError: cannot load Java class com.sun.jna.NativeLibrary
        from (irb):1:in `method_missing'
        from (irb):1:in `binding'

the jna.jar is in ENV['CLASSPATH'] so I thought this should work?

Then I cd $JRUBY_HOME/lib so that I'm in the same dir as jna.jar and did the 
following:
irb(main):001:0> require 'java'
=> true
irb(main):002:0> require 'jna.jar'
=> true
irb(main):003:0> N = com.sun.jna.NativeLibrary
NameError: cannot load Java class com.sun.jna.NativeLibrary
        from (irb):1:in `method_missing'
        from (irb):1:in `binding'

Notice the require 'jna.jar' worked since the jar file is in the same directory 
I launched jirb from.  I tried to require 'jna.jar' from directory other than 
location of jna.jar to no avail:
irb(main):002:0> require 'jna.jar'
LoadError: no such file to load -- jna
        from (irb):1:in `require'
        from (irb):1:in `binding'

This is happening on Windows and linux.  I'm trying to follow the documentation 
out there (example require jar from jruby wiki) and can't seem to get this to 
work.

Using core classes (java.lang.String) works as expected.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email

Reply via email to