aspose file tools*
The moose likes C / C++ and the fly likes How to create a JVM in native code and call a Java Method from a Java Class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "How to create a JVM in native code and call a Java Method from a Java Class?" Watch "How to create a JVM in native code and call a Java Method from a Java Class?" New topic
Author

How to create a JVM in native code and call a Java Method from a Java Class?

Lavakush Verma
Greenhorn

Joined: Jul 09, 2010
Posts: 3
Dear All !

I am trying to call a java method from native code (C/C++), to which i ll need the instance of JVM at Native code. but i am unable to get success regarding that issue. The scenario is like..

I have a c code running, within main() function i need to call the java method based on some conditions. when i m trying to create the JVM at main() function before the Java method call it is not even compiling successfully.

Error : createJVM.c:18: undefined reference to `JNI_CreateJavaVM'
collect2: ld returned 1 exit status






i am putting my source code here..
please help me. I am an urgent need to solve this issue...

Regards,

LK
Lavakush Verma
Greenhorn

Joined: Jul 09, 2010
Posts: 3
Dear Friends,
I have also tried help from this link..
but could not succeed to compile my C Code.

http://www.codeproject.com/KB/cpp/CJniJava.aspx

Regards,
Lavakush
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create a JVM in native code and call a Java Method from a Java Class?