Re: Under Linux, Call java from C++



On 30 Sep 2005 08:28:33 -0700, tony_lincoln@xxxxxxxxx wrote:
> When I remove this line,
> vm_args.version = JNI_VERSION_1_4;

It sounds like you are using an earlier version of java - try using
JNI_VERSION_1_2, or check the value of JAVA_HOME.

What does "java -version" say?

> I can get invoke.o and invoke. But when I typed invoke, there is one
> error:
> error while loading shared libraries: libjvm.so: cannot open shared
> object file: No such file or directory
>
> I guess that is the problem about LD_LIBRARY_PATH. But I set it already
> in bashrc file...

LD_LIBRARY_PATH is what I'd check too. Where does JAVA_HOME point? Can
you find libjvm.so yourself somewhere in or below JAVA_HOME?

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
.



Relevant Pages

  • Re: JAVA as C (or C++) Front End
    ... Whenever I write and compile a ... > java program, I have to invoke it by calling Java.EXE. ... > software which is obviously written in Java which is invoked with an EXE ... One 'pro' for having the the C code invoke the java code is that you will then ...
    (comp.lang.java.programmer)
  • Re: java - invoke
    ... You have stumbled on one of the most subtle features of Java called ... You create call lists of parameters on the fly and invoke methods. ... It is a tool to allow java code to use arbitrary class files handed to ... You can usually get what you want without resorting to reflection ...
    (comp.lang.java.help)
  • Re: Problem Passing args to Java from Matlab
    ... just use a matlab string ... I'm using a java api from Matlab, and I can not get the call data ... Then I try to call invoke. ... str = java.lang.String ...
    (comp.soft-sys.matlab)
  • Need advise on using java for RPC
    ... I'm new to java and web services. ... string command to be used as input argument for my compute.exe ... the form of XML and send via http to the server. ... I set up a webservice using J2EE, how do I invoke my compute.exe? ...
    (comp.lang.java.programmer)
  • Re: finalize() not guaranteed to be called -- ever
    ... Then the Java object should have some kind of dispose method. ... It is very different in that it is possible to write C++ programs in which the destructors are never invoked manually but do run. ... C++ you can put objects on the heap as well and when you do the destructor is called manually using the delete statement. ... Either the object itself is stack based or you use a stack based object to invoke the ...
    (comp.lang.java.programmer)