views:

115

answers:

2

First off I'm on Ubuntu linux if that matters.
I have a simple project idea based off of FreeTTS and the JSAPI (Java Speech API)

I've downloaded and unpacked FreeTTS and run their build script. Then tried compiling my code linking several jar's required in the lib directory into the class path like this:

javac -cp /home/travis/Desktop/freetts-1.2/lib/jsapi.jar:/home/travis/Desktop/freetts-1.2/lib/freetts.jar HelloUnleashedReader.java

Which then compiles to java bytecode just fine. However when I run:

java HelloUnleashedReader

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/speech/EngineModeDesc

Any help on this issue would be greatly appreciated as there are many sites around the net discussing problems with getting it to work but not many that discuss their solution.

A: 

You need to add the jsapi.jar into your classpath. The jsapi.jar can be unpacked by running lib/jsapi.exe inside the freetts installation directory.

Samuel Yung
I tried this and got the same error.
Travis
Can you try:java -cp /home/travis/Desktop/freetts-1.2/lib/jsapi.jar:/home/travis/Desktop/freetts-1.2/lib/freetts.jar:. HelloUnleashedReader
Samuel Yung
A: 

Greetings Travis,

It would appear that Samuel Yung is on the right track but I see that you are using Ubuntu. You must agree to the binary license before you can use jsapi.jar. You agree to this license in the process of unpacking it. To unpack jsapi.jar in Ubuntu you would type the following:

cd ~/Desktop/freetts-1.2/lib

chmod +x ./jsapi.sh

./jsapi.sh

if you receive a message like "./jsapi.sh: 1428: uudecode: not found" then install uudecode with

sudo apt-get install sharutils

and try again

William Deans