• Post Reply Bookmark Topic Watch Topic
  • New Topic

embed java in native code  RSS feed

 
muthu muruges
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to invoke java methods with user defined class as return type from the C code. Can you please give an example using JNI? Please let me know how to generate the 'C' structres from the user defined classes.

Thanks,
Muruges
 
nikos sokaf
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the online tutorial about JNI:
http://java.sun.com/docs/books/tutorial/native1.1/index.html

You will find out a good starting example!
 
muthu muruges
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I need a JNI 'C' example that invokes java method which is having user defined object as return type. Is it possible to generate a 'C' structure that is equivalent to the user defined java object. And that structure need to be populated with the values in the returned java object automatically.
 
David Gospel
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
m muruges

This display name doesn't comply to the JavaRanch naming rules described here

We require your display name to be two words: your first name, a space, then your last name. Obviously short first name (like that above) is not allowed. Accounts with invalid display names get deleted, often without warning.

If you want to get help from this community, we require that you follow the rules of the community.

Thanks, Anna
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!