This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Lavakush Verma
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic