7

Please tell me if it is possible to do the following:

  • create an instance of a specific class in Java
  • pass it to JRuby to do something with it
  • continue using the "modified" version in Java

May you provide a small working example?

EDIT: It turns out that embedding was the simplest way to achieve this. More information is available on Embedding JRuby.

0

3 Answers 3

4

Yes it's possible. This page on the JRuby wiki should get you started.

Sign up to request clarification or add additional context in comments.

Comments

1

This was the solution I used : Direct JRuby embedding

1 Comment

Looks like you have some link rot here, is there another link that could be used here (and hopefully summarized in the answer to avoid this problem in the future?)
0

It depends on what you mean by "do something". If you mean "redefine a method", then the answer is no, not really. The new method will be used by jruby, but any calls to the method in java will continue to invoke the old method.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.