gpt4 book ai didi

成功清理和构建后 JavaCV 无法运行

转载 作者:搜寻专家 更新时间:2023-11-01 03:41:19 24 4
gpt4 key购买 nike

我用 java 完成了一个项目,即使用 javaCV 库的运动检测软件。当我从 netbeans 调试代码时它工作正常。它检测运动并发出警报、发送邮件等。但是当我清理和构建代码时,获得的 .jar 文件没有加载网络摄像头。当我打开那个 .jar 文件时,它显示一个空白 Canvas 。我可以提供的另一个信息是,当我清理和构建时,o/p 会显示一些警告,例如已弃用的 API。


init:
deps-clean:
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build
Updating property file: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\built-clean.properties
Deleting directory C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build
clean:
init:
deps-jar:
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build
Updating property file: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\built-jar.properties
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\classes
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\empty
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\generated-sources\ap-source-output
Compiling 35 source files to C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\classes
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:7: warning: String is internal proprietary API and may be removed in a future release
import com.sun.org.apache.xpath.internal.operations.String;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:17: warning: AudioPlayer is internal proprietary API and may be removed in a future release
import sun.audio.AudioPlayer;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:18: warning: AudioStream is internal proprietary API and may be removed in a future release
import sun.audio.AudioStream;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:12: warning: AudioStream is internal proprietary API and may be removed in a future release
import sun.audio.AudioStream;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:32: warning: String is internal proprietary API and may be removed in a future release
String t;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:36: warning: String is internal proprietary API and may be removed in a future release
static String user;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:287: warning: AudioStream is internal proprietary API and may be removed in a future release
AudioStream as = null;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:300: warning: AudioStream is internal proprietary API and may be removed in a future release
as = new AudioStream(in);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:312: warning: AudioPlayer is internal proprietary API and may be removed in a future release
AudioPlayer.player.start(as);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\NewJFrame1.java:502: warning: String is internal proprietary API and may be removed in a future release
public static void main(String args[]) {
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:44: warning: AudioStream is internal proprietary API and may be removed in a future release
AudioStream as;
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:109: warning: AudioStream is internal proprietary API and may be removed in a future release
as = new AudioStream(in);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:220: warning: AudioPlayer is internal proprietary API and may be removed in a future release
AudioPlayer.player.start(as);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:232: warning: AudioStream is internal proprietary API and may be removed in a future release
as = new AudioStream(in);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:281: warning: AudioPlayer is internal proprietary API and may be removed in a future release
AudioPlayer.player.stop(as);
C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\src\projectlogin\operation.java:286: warning: AudioPlayer is internal proprietary API and may be removed in a future release
AudioPlayer.player.stop(as);
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 warnings
Copying 15 files to C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build\classes
compile:
Created dir: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\dist
Copying 1 file to C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\build
Copy libraries to C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\dist\lib.
Building jar: C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\dist\projectlogin.jar
To run this application from the command line without Ant, try:
java -jar "C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\dist\projectlogin.jar"
jar:
BUILD SUCCESSFUL (total time: 7 seconds)

最佳答案

输出表明您应该从命令行 java -jar "C:\Users\Anooj\Documents\NetBeansProjects\projectlogin\dist\projectlogin.jar

如果您从 dist 目录运行它,它将包含项目所需的库。我怀疑您正在尝试在没有关联库的情况下运行该项目。

关于成功清理和构建后 JavaCV 无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13657712/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com