Installing and verifying JVoiceXml
The following steps were tested on this combination:
- Windows 8.1 Pro 64-bit
- JavaSE JDK 1.7.55 32-bit
- Eclipse Juno SR2 32-bit
- Download the JVoiceXml 0.7.6.1GA (or higher) installer jar from http://sourceforge.net/projects/jvoicexml/
- Unpack that zip and double-click the jar installer
- Instead of installing to
C:\Program Files (x86)\
, install to some folder on your Desktop. (The default location runs into a permissions error for me; maybe it’s intended that the installer jar be run with Admin privilege.) - When prompted which modules to install, choose “Text Implementation” (skipping jsapi through mrcp and the call manager). However, “VoiceXML Unit” through “Source Code” will probably be useful later on.
- Check the
doc
folder of your installation for the user guide, which provides further installation steps. The following steps are based on it. - Open the following in a text editor:
config/text-implementation.xml
Verify that the classpath element values correspond to files that actually exist in your installation folder (even if the user guide gives different values). - At a commandline, run
[installation dir]\bin\JVoiceXML.exe
. If you don’t seeVoiceXML interpreter [version] started.
then check the user guide for troubleshooting guidance. Leave this window undisturbed, and if you want to stop the server, make sure to use Shutdown.exe instead of closing the window or using Ctrl+C.
- Using Eclipse (Juno) IDE, go to File | New | “Java Project from Ant buildfile…”
- For “Ant buildfile” browse to
JVoiceXml\demo\org.jvoicexml.demo.textdemo\build.xml
- “Project name” should now be auto-filled and the Finish button should be enabled.
- Select the project in the left pane, then select Run | Run Configurations…
- Select “Java Application” in the left pane, then click the button at top whose on-hover tip shows “New launch configuration”. Name the new launch config something meaningful to your memory like “JVoiceXmlTextDemo”.
- Select the Arguments tab, then paste
-Djava.security.policy=${config}/jvoicexml.policy
into the “Program arguments” textarea, replacing
${config}
with the full path to the config folder within the text demo folder. For example,-Djava.security.policy=C:\Users\david\Desktop\Tools\JVoiceXml\demo\org.jvoicexml.demo.textdemo\config\jvoicexml.policy
- Select the Classpath tab. Select “User entries” then click the Advanced button. Select the “Add External Folder” radio button, then click OK. Browse to the config within the text demo folder. When you return to the Classpath tab, click Apply. If instead you select the config folder at the top-level, later you will get an error like this in the Eclipse console:
Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
- Select the Main tab, then click Search to select TextDemo. Make sure the package shown for TextDemo is from jvoicexml. Click Apply.
- In TextDemo.java, the imports of
org.jvoicexml.client.text.TextListener
andorg.jvoicexml.client.text.TextServer
might be shown as missing. If so, select the project in the left pane, then select Project | Properties | Java Build Path | Libraries | Add External Jar, and browse toJVoiceXml\lib\org.jvoicexml.client.text.jar
- WARNING: I still run into java security errors like this:
Exception in thread "JVoiceXML text server" java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:4242" "listen,resolve")