简体   繁体   中英

how to use java based project in firebreath plugin framework

I am trying to develop a HTML5 plugin using NPAPI and firebreath framework. The code which needs to be used, is written in java but I need to convert it into C++. The only way i know is via JNI where i need to convert each .java file into .cpp file. However there are over 200 files in my project. Is there a better way to achieve this??

Any "simple" way would be more of a c++ question than a plugin or firebreath question. My guess is that you'd be far better off just making it an applet rather than a plugin if you want it mainly in java. There is nothing that I'm aware of that will make it easy for you to do what you want to do using FireBreath or NPAPI directly.

JNI doesn't convert Java to C++, it is a technology for calling native code (such as C or C++) from Java code. It doesn't seem relevant to your problem: Either you (manually or robotically) convert all your Java to C++ (which you can then call from Firebreath), or you keep your code in Java and run an applet (with no C/C++ code involved.) If an applet as suggested by @taxilian isn't a good choice, why not turn your Java project into an application, and have your Firebreath plugin launch that and communicate with it? Your plugin could even download and install the Java app, for example in a temp folder. One limitation: The Java code won't have any direct access to internal browser API's, the Firebreath plugin would have to make any such calls on behalf of the Java app. How hard this all is would mainly depend on the complexity and bandwidth of communication needed between the web page and the Java code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM