dcsimg
I have a complete C++ application. I want to call main() from java. Is that possible?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   calin_calin
Posted On:   Thursday, November 13, 2003 04:03 AM

HelloWorld works fine!
When comming to real things is not easy (me=beginner in JNI). Is it enough to make wrapper of the main or I should make JNI wrappers for all classes in the C++ hierarchy?

Re: I have a complete C++ application. I want to call main() from java. Is that possible?

Posted By:   Eric_Maginniss  
Posted On:   Thursday, November 13, 2003 11:23 AM

I would tend to make a wrapper for the main entry point that works with whatever package you want your java code to be in. So, you would have four parts to your system:
  • C++ code with main() entry point
  • C++ wrapper code with a method name that matches your package which only calls the main() listed above
  • The java wrapper classes that defines the native method listed above
  • The java application which would call your native code through the java wrapper
About | Sitemap | Contact