• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

embed java in native code

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic