FreeTTS 和 JSAPI 工作时遇到问题
首先,如果重要的话,我使用的是 Ubuntu linux。
我有一个基于 FreeTTS 和 JSAPI(Java Speech API)的简单项目想法,
我已经下载并解压了 FreeTTS 并运行他们的构建脚本。然后尝试编译我的代码,将 lib 目录中所需的几个 jar 链接到类路径中,如下所示:
javac -cp /home/travis/Desktop/freetts-1.2/lib/jsapi.jar:/home/travis/Desktop/freetts-1.2/lib/freetts.jar HelloUnleashedReader.java
然后编译为 java 字节码就好了。 但是,当我运行时:
java HelloUnleashedReader
我收到以下错误:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/speech/EngineModeDesc
对于此问题的任何帮助将不胜感激,因为网络上有许多站点讨论使其正常工作的问题,但讨论其解决方案的站点并不多。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现你正在使用 Ubuntu。您必须同意二进制许可证才能使用 jsapi.jar。您在解包过程中同意此许可。要在 Ubuntu 中解压 jsapi.jar,您需要输入以下内容:
如果您收到类似的消息
然后安装 uudecode 并重
试
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:
if you receive a message like
then install uudecode with
and try again
您需要将 jsapi.jar 添加到类路径中。可以通过运行 freetts 安装目录中的 lib/jsapi.exe 来解压 jsapi.jar。
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.
尽管类路径上有 jsapi.jar,但我还是收到了此错误。
对我有帮助的是明确指定主类:
可能是 JAR 元数据中出现了问题。
I got this error despite I had jsapi.jar on classpath.
What helped me was specifying the main class explicitely:
Probably something wrong in the JAR metadata or so.