• Advertisement
Sign in to follow this  

[java] JNI alternatives?

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have heard nothing positive about the java native interface. I am curious about alternative libraries or even other VM implementations that allow easily managed executions of input Java code in C or C++? EDIT: for grammer/speeeeling

Share this post


Link to post
Share on other sites
Advertisement
Brutal, thank you.

I googled everything under the sun (no pun intended) except for that.

Also, I would like to actually hear some input on those, since a few links are dead and some are linked to commercial products (I'm not sure if those are a possibility).

I am a bit more interested in having an embedded JVM that can compile to bytecode/run user input code. I wanted to keep my initial post short until a dialogue could be established on possible choices and I could get human input on JNI.

It seems as if JNI and it's wrappers are more about interfacing static Java with static C++.

EDIT: I understand now, static Java loaded by JNI loads user input Java into the JVM. I just hope there is good error reporting x.x.

[Edited by - mrcriminy on April 21, 2008 4:07:55 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by mrcriminy

I am a bit more interested in having an embedded JVM that can compile to bytecode/run user input code.


JVM can't compile anything. It's a virtual machine, not a compiler. There exist compilers which generate Java byte-code from certain source code.

Quote:
It seems as if JNI and it's wrappers are more about interfacing static Java with static C++.


JNI is an interface that describes how C/C++ code can access JVM run-time environment.

Quote:
EDIT: I understand now, static Java loaded by JNI loads user input Java into the JVM. I just hope there is good error reporting x.x.


JVM runs byte-code and nothing more. There is no static Java, whatever that is supposed to mean. Certain members can be declared as static, but that's a Java or C/C++ language feature.

Error reporting is very trivial. A class either loads or it doesn't. If it loads, it means it passed the byte-code verifier and is valid. Otherwise it doesn't load.

If what you're thinking is using JVM as scripting engine, then there's things like BeanShell.


A much better approach would be to describe what you're trying to do.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement