Using the
JSAPI in Applets and with the Java Plugin
Since this implementation of the JSAPI
will run under a Java1.1 VM, it is possible to use it from an ordinary
Applet in a suitable browser (eg Netscape 4.7 or above or IE 5.0 or above
with Java VM version 5 - install SP 2 for IE 5.5), provided:
-
EITHER: Execute Setup.exe, which
will start up a Java GUI which will let you install the JSAPI libraries
in the correct locations to be used by the native VMs in Netscape and Internet
Explorer.
-
OR manually install the cgjsapiNNN.dll
(eg, cgjsapi160.dll) and cgjsapi.jar files as follows:
-
For Internet Explorer
-
Copy cgjsapiNNN.dll to the "WINDOWS"
folder, eg C:\WINDOWS
-
EITHER
-
Store the cgjsapi.jar somewhere, and
modify the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\Classpath" value
in the registry to include the path to that cgjsapi.jar file.
-
OR, Copy cgjsapi.jar to the C:\WINDOWS\Java\Classes
folder and move to that folder, then execute the command "jar xf cgjsapi.jar".
Note that if you use this option you may run into some security restrictions
with the Microsoft VM.
-
OR, Copy the cgjsapi.jar file to the
C:\WINDOWS\Java\TRUSTLIB folder (for Win2k platforms)
-
For Netscape
-
Copy cgjsapiNNN.dll to C:\Program Files\Netscape\Communicator\Program\java\bin
-
Copy cgjsapi.jar to C:\Program Files\Netscape\Communicator\Program\java\classes
-
If redirecting audio to or from a speech
engine (ie, to/from a file or across the network), Sun's JMF 2.1.1 implementation
will need to be installed for use by Applets.
An example of a JSAPI-enabled Applet
is shown here. The code is
here. You may setup
your browser to either use Sun's Java Plugin or the native Java VM supplied
with the browser. If you use Sun's plugin, you will need to create or modify
your policy file as described in the Security section.