Code Monkey home page Code Monkey logo

Comments (7)

jrobsonchase avatar jrobsonchase commented on May 28, 2024 5

I've started work on some additions to the invocation api in the invocation_api branch. Feel free to comment, test, PR, etc. from there and when we're all satisfied, I'll merge it to master.

from jni-rs.

dmitry-timofeev avatar dmitry-timofeev commented on May 28, 2024 3

Hi @jechase , we've used the tip from invocation_api branch for a while in some integration tests, and it seems to work properly. Is there anything you plan to put in it before releasing, maybe something we can help with?

from jni-rs.

fpoli avatar fpoli commented on May 28, 2024 2

This is exactly our use case, I'm really interested in this development.

At the moment we are using an adapted version of the Jvm::new function from Rucaja to start the JVM, then we switch to jni-rs with JNIEnv::from_raw. It works fine for us. The only missing part in jni-rs is the link to the dynamic library, so we had to:

  • add links = "jvm" and build = "build.rs" to our Cargo.toml
  • add a #[link(name = "jvm")] extern "C" {} somewhere (e.g. lib.rs)
  • write a build.rs that configures the dynamic library location (an example is here, with a related issue)

In general, I think it can be very useful to have a look at Rucaja, because it already implements the "call JVM from Rust" part. A merge of the two would be great, because most of the functionalities (call a method, call a static method, ...) are duplicated.

from jni-rs.

jrobsonchase avatar jrobsonchase commented on May 28, 2024 1

OK, let me see if I have this straight, since I haven't looked at the invocation api at all since it's not part of our use case.

  1. You want to start a JVM from rust and
  2. That requires linking to a the JVM dynamic library

If implemented, it's probably something that we'll want to put behind a cargo feature, since unconditionally requiring linkage to the jvm lib might be undesirable. Otherwise, sounds like a great thing to have, and would make #61 actually doable.

from jni-rs.

jrobsonchase avatar jrobsonchase commented on May 28, 2024 1

Hey, sorry, been out for the holidays. I don't think there was anything else that I was planning to add to it. If everything's been good with it so far, I'll go ahead and merge it :)

from jni-rs.

dmitry-timofeev avatar dmitry-timofeev commented on May 28, 2024

@fpoli , thank you a lot for the references, we'll definitely look at Rucaja closer to see how to make things work together!

from jni-rs.

dmitry-timofeev avatar dmitry-timofeev commented on May 28, 2024

Works like a charm, thank you a lot!

from jni-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.