Java应用程序无法从命令提示符处运行 [英] Java application is not working from command prompt

查看:222
本文介绍了Java应用程序无法从命令提示符处运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


i用eclipse IDE实现了java应用程序。它正在运行并且与eclipse一起工作正常。但是当我用代码创建执行的JAR文件时。它给出了以下错误。如果我错过了什么,请告诉我。





线程中的异常"pool-2-thread-1" java.lang.UnsatisfiedLinkError:com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI.swig_module_init()V
$
       在com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI.swig_module_init(原生方法)

  &NBSP; &NBSP; &NBSP;在com.microsoft.cognitiveservices.speech.internal.carbon_javaJNI。< clinit>(carbon_javaJNI.java:517)

  &NBSP; &NBSP; &NBSP;在com.microsoft.cognitiveservices.speech.SpeechConfig。< clinit>(SpeechConfig.java:69)

  &NBSP; &NBSP; &NBSP; at com.autoAnalyser.AudioToTextConverter.configureService(AudioToTextConverter.java:38)

  &NBSP; &NBSP; &NBSP;在com.autoAnalyser.ServiceThread.run(ServiceThread.java:21)

  &NBSP; &NBSP; &NBSP; at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

  &NBSP; &NBSP; &NBSP; at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)

  &NBSP; &NBSP; &NBSP;在java.lang.Thread.run(未知来源)


线程中的异常" pool-55-thread-1" java.lang.NoClassDefFoundError:无法初始化类com.microsoft.cognitiveservices.speech.SpeechConfig

  &NBSP; &NBSP; &NBSP;在com.autoAnalyser.AudioToTextConverter.configureService(AudioToTextConverter.java:38)

&NBSP; &NBSP; &NBSP; &NBSP;在com.autoAnalyser.ServiceThread.run(ServiceThread.java:21)

&NBSP; &NBSP; &NBSP; &NBSP; at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

&NBSP; &NBSP; &NBSP; &NBSP; at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)

&NBSP; &NBSP; &NBSP; &NBSP; at java.lang.Thread.run(Unknown Source)










JVM详情: 


java version" 1.8.0_191"

Java(TM)SE运行时环境(版本1.8.0_191-b12)

Java HotSpot(TM)64位服务器VM(版本25.191-b12,混合模式)



< p style ="border:none; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif;概要:0像素;填充右:0像素;颜色:#333333; font-size:14px">
我前一天在GitHub中提出了请求,但是还没有收到任何回复。我使用的是Windows 10操作系统,GitHub的发行号是190.我还上传了POM和源代码我提到了 https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstart-java-jre



我已经使用eclipse IDE实现了java应用程序。它正在运行并且正常运行eclipse。但是当我用代码创建了执行的JAR文件时。它给出了以下错误。请让我知道如果我遗漏了任何东西。



https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/190






解决方案


<你可以确定你正在使用:


Windows(64位),Ubuntu Linux 16.04 / 18.04(64位),或macOS 10.13或后期


还有,请你确保你打电话  SpeechConfig.fromSubscription(KEY,REGION)(或其中一个来自*()函数)至少一次在
之前创建你的流类。 
原因是语音sdk在内部仅在"条目"类中自动加载本机dll,如SpeechConfig或Recognizer类。


问候,


宇通






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.<clinit>(carbon_javaJNI.java:517)
        at com.microsoft.cognitiveservices.speech.SpeechConfig.<clinit>(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.

https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/190


解决方案

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 call SpeechConfig.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



这篇关于Java应用程序无法从命令提示符处运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆