Re: Need to recompile a Java Applet as an Executable
On 29-01-2010 02:53, Sanny wrote:
I have a Java Applet which is quite slow.
There are a few functions that are called by the Java Applet. I want
those functions to be run as fast as possible.
Using applets for CPU intensive work is not an obvious choice.
Does an Applet support native language?
Can I create a C++ / C function and ask the applet to call that C
function that is run on Users Computer? And get back the output and
display on the Applet?
You can certainly call C code from Java using JNI.
How to distribute my applet with C/ C++ dll/ That Applet accesses?
If I remember correctly then applet and JNI requires the native
dynamic library (.dll, .so or whatever it is called on the specific
platform) to already be on the client.
Java Web Start may be different.
I want that users who are not satisfied with the slow version. They
will need to use the Signed Applet. Once they allow the Signed applet
to access the Computer. The applet will load the C/ C++ dll / ActiveX
on the Computer / Webpage.
I want communication between Activex and the Applet for quick
computation.
Why an ActiveX plugin?
Communication between an ActiveX plugin and an applet sounds
both cumbersome and slow.
Will the Activex/ DLL be 10-20 times faster than an Applet?
Most likely not.
You chances of winning in powerball is probably better.
Will I have to create different ddl/ ActiveX for different platforms?
Different JNI native dynamic library for every platform you want
to support.
ActiveX is Windows only.
Say for Mac os/ Linux/ Windows etc? Do I need to create a different
ActiveX?
Does not exist.
Which C/C++ free package should I use to create this function. I just
want a few functions to be executed quickly by native language and
return the output to the applet. So I want a free editor where I can
compile the C/ C++ functions.
To use JNI you just need Java and any C/C++ compiler for the platforms
you intend to suppport.
For ActiveX you should go for some combination of Visual C++
and Platform SDK.
Please suggest me a good example or diagram of how to proceed. Will I
need Corba/ XML feature for Applet& Activex communication?
I can not see any reason to also throw CORBA and XML into the mix.
Using any technology under the sun will not make your app faster.
Will this
setup work on all web browsers?
ActiveX will only work with IE.
JNI should work for all browsers on the platforms you create it for.
Does flash works faster than Java? Can I use those functions in Flash.
Wil a function run on Flash as fast as a Native Language?
I am far from a Flash expert.
But CPU intensive calculations does not seem to be something
Flash is used for (excluding video related calculations !), so
I very much doubt that Flash is optimized for such.
Arne