Howdy-
I'm trying to build a simple connection to Oracle using JRuby. I'm a
JRuby newbie, so my method may be quite flawed. But I cannot seem to
get JRuby to recognize jars in the classpath (demonstration below). I
wonder if anyone can see what I'm doing wrong?
$ jar -tf lib/classes12.jar | grep OracleDriver
oracle/jdbc/driver/OracleDriver.class
oracle/jdbc/OracleDriver.class
$ java -classpath "./lib/classes12.jar" -jar
/usr/local/jruby/lib/jruby.jar
require 'java'
include_class 'oracle.jdbc.driver.OracleDriver'
puts 'hi'
C:\jruby\src\builtin\javasupport.rb:258:in `for_name': cannot load Java
class oracle.jdbc.driver.OracleDriver (NameError)
from C:\jruby\src\builtin\javasupport.rb:258:in
`get_proxy_class'
from (eval):0:in `include_class'
from -:2:in `each'
from C:\jruby\src\builtin\javasupport.rb:405:in `include_class'
from -:2
$ cat conn_test.java
import oracle.jdbc.driver.OracleDriver;
class conn_test {
public static void main (String[] args) {
System.out.println("Hi");
}
}
$ javac -classpath "lib/classes12.jar" conn_test.java
$ java -classpath ".:lib/classes12.jar" conn_test
Hi
Thanks.
-J