Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8118915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:38:37+00:00 2026-06-06T04:38:37+00:00

I have a JRuby project that connects to an Oracle database using JDBC via

  • 0

I have a JRuby project that connects to an Oracle database using JDBC via Oracle’s ojdbc6.jar library. The code works well when run using JRuby 1.6.6 on Windows 7 and JRuby 1.6.5.1 on OS X Lion. I’m trying to create a standalone JAR file using warbler. After running warble jar it includes the ojdbc6.jar but for some reason it does not load/access it. It seems the internal classpath is incorrect or I’m not configuring something right.

Following directory structure exists.

C:\my_jruby_project\bin\my_jruby_file.rb
C:\my_jruby_project\lib\java\ojdbc6.jar
C:\my_jruby_project\Gemfile

C:\my_jruby_project\Gemfile:

source :rubygems
gem 'activerecord', '>= 3.2.3'
gem 'activerecord-jdbc-adapter', '>= 1.2.2'
gem 'ruport', '>= 1.6.3'

C:\my_jruby_project\bin\my_jruby_file.rb

require 'ruport'
require 'java'

java_import 'oracle.jdbc.OracleDriver'
java_import 'java.sql.DriverManager'
....

After generating the JAR file:

jruby -S warble jar

I execute the jar and get the following error:

C:\my_jruby_project>java -jar my_jruby_project.jar
NameError: cannot load Java class oracle.jdbc.OracleDriver
         for_name at org/jruby/javasupport/JavaClass.java:1205
  get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
      java_import at file:/C:/Users/DAVIDH~1.OPE/AppData/Local/Temp/jruby8647327738550400677extract/
jruby-core-1.6.7.jar!/builtin/javasupport/core_ext/object.rb:46
           (root) at file:/C:/my_jruby_project/my_jruby_project.jar!/my_jruby_project/bin/my_jruby_file.rb:4
             load at org/jruby/RubyKernel.java:1058
           (root) at file:/C:/my_jruby_project/my_jruby_project.jar!/my_jruby_project/bin/my_jruby_file.rb:1
          require at org/jruby/RubyKernel.java:1033
          require at file:/C:/my_jruby_project/my_jruby_project.jar!/META-INF/main.rb:36
           (root) at <script>:3

C:\my_jruby_project>

The generated JAR includes the lib/java/ojdbc6.jar but it seems internal file or path pointers are not configure correctly.

Appreciate any assistance. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:38:39+00:00Added an answer on June 6, 2026 at 4:38 am

    You may want to setup $CLASSPATH inside your ruby code.
    Something similar to this:

    require 'java'
    $CLASSPATH << "lib/java/ojdbc6.jar"
    

    I use some extra jars in my jruby on rails project and have the following code in my environment.rb in order for the .jars to be accessible in my .war deployment:

    require 'java'
    Dir.glob("lib/*.jar").each do |jar|
      $CLASSPATH << "#{Rails.root.to_s}/#{jar}"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm considering using JRuby on App Engine but have heard that Juby app on
I have a simple Rails 3.1 CRUD app built using Oracle running on JRuby.
Is anyone using Jruby in emacs? I have setup emacs and it works perfectly
I have a Java project that is using Cucumber for BDD. This morning the
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB
Any advice on Git repository organization for starting a new project on JRuby that
I have a Web application using Jruby and Sinatra (App Engine) and I want
I have developed a simple DSL for tasks on a UniVerse database in jruby.
I am trying to configure JRuby using RVM on Ubuntu Linux. I have successfully
I am using Jruby and rails 2.2.2. My problem is I have a migration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.