i have implemented java application with eclipse IDE. It is running and working fine with eclipse. But when i have created executed JAR file with the code. It is giving below error. Please let me know if i have missed anything.
Exception in thread "pool-2-thread-1" java.lang.UnsatisfiedLinkError: com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI.swig_module_init()V
at com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI.swig_module_init(Native Method)
at com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI.(carbon_javaJNI.java:517)
at com.microsoft.cognitiveservices.speech.SpeechConfig.(SpeechConfig.java:69)
at com.autoAnalyser.AudioToTextConverter.configureService(AudioToTextConverter.java:38)
at com.autoAnalyser.ServiceThread.run(ServiceThread.java:21)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-55-thread-1" java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.cognitiveservices.speech.SpeechConfig
at com.autoAnalyser.AudioToTextConverter.configureService(AudioToTextConverter.java:38)
at com.autoAnalyser.ServiceThread.run(ServiceThread.java:21)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
JVM details :
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
I have raised request in GitHub a day before yesterday but did not receive any response yet. I am using Windows 10 OS and GitHub issue number is 190. I have also uploaded POM and source code. I referred https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstart-java-jre
I have implemented java application with eclipse IDE. It is running and working fine with eclipse. But when i have created executed JAR file with the code. It is giving below error. Please let me know if I have missed anything.
解决方案
Hi,
Could you please make sure you are using:
Windows (64-bit), Ubuntu Linux 16.04/18.04 (64-bit), or macOS 10.13 or late
And also, could you please make sure that you callSpeechConfig.fromSubscription(KEY, REGION) (or one of the other from*() functions) at least once before
creating your stream class.The reason is that the speech sdk internally loads the native dll only at the "entry" classes automatically, like SpeechConfig, or Recognizer classes.
Regards,
Yutong