java classpath for yajb

Discussion in 'Ruby' started by Elmar Schraml, Nov 27, 2006.

  1. Hi,

    I'm trying to use a java class via yajb in Ruby on Rails.
    yajb works fine for calling Java library classes, but I can't get my
    own java classes to work.

    I have:
    - a class file anon.example.ImportTest in directory
    /home/elmar/railswork/myapp/lib/java/anon/example
    - a controller with JBRIDGE_OPTIONS = { :classpath =>
    '/home/elmar/railswork/myapp/lib/java' }

    yet instantiating a ruby variable like
    testvar = jnew :ImportTest
    fails.

    Is there anything obvious I'm doing wrong?

    Thanks for any help,
    Elmar
    Elmar Schraml, Nov 27, 2006
    #1
    1. Advertising

  2. Elmar Schraml

    Tom Copeland Guest

    On Mon, 2006-11-27 at 19:50 +0900, Elmar Schraml wrote:
    > Hi,
    >
    > I'm trying to use a java class via yajb in Ruby on Rails.
    > yajb works fine for calling Java library classes, but I can't get my
    > own java classes to work.


    Hm, check out this YAJB presentation here:

    http://novarug.org/articles/2006/07/20/august-novarug-meeting

    I think Paul said something about CLASSPATH in there...

    Yours,

    tom
    Tom Copeland, Nov 27, 2006
    #2
    1. Advertising

  3. Elmar Schraml

    Paul Stadig Guest

    Here's a direct link to the slides:
    http://paul.stadig.name/assets/2006/11/7/Ruby_Presentation.pdf

    You have to configure YAJB with the JBRIDGE_OPTIONS constant. There's
    an example on page 9.

    Feel free to e-mail me directly () if you have other
    questions.


    Good Luck,
    Paul

    Tom Copeland wrote:
    > On Mon, 2006-11-27 at 19:50 +0900, Elmar Schraml wrote:
    >> Hi,
    >>
    >> I'm trying to use a java class via yajb in Ruby on Rails.
    >> yajb works fine for calling Java library classes, but I can't get my
    >> own java classes to work.

    >
    > Hm, check out this YAJB presentation here:
    >
    > http://novarug.org/articles/2006/07/20/august-novarug-meeting
    >
    > I think Paul said something about CLASSPATH in there...
    >
    > Yours,
    >
    > tom



    --
    Posted via http://www.ruby-forum.com/.
    Paul Stadig, Nov 28, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabe
    Replies:
    3
    Views:
    1,054
  2. Sakurai Masashi

    [ANN] yajb 0.5.0

    Sakurai Masashi, Jul 19, 2005, in forum: Ruby
    Replies:
    1
    Views:
    99
    Sakurai Masashi
    Jul 19, 2005
  3. pat eyler

    Anyone using yajb in production?

    pat eyler, Sep 23, 2005, in forum: Ruby
    Replies:
    0
    Views:
    79
    pat eyler
    Sep 23, 2005
  4. Tom Harris

    Getting YAJB to work at all

    Tom Harris, Jan 13, 2006, in forum: Ruby
    Replies:
    10
    Views:
    257
    Tom Harris
    Jan 15, 2006
  5. YAJB and JDBC?

    , Sep 1, 2006, in forum: Ruby
    Replies:
    2
    Views:
    100
    Adam Keys
    Sep 1, 2006
Loading...

Share This Page