Netbeans/java:无法找到或加载主类库
由于某些Windows问题,不幸地重新安装了我的整个计算机之后,我试图在Linux Mint上设置我的开发环境.对于Java程序的开发,我使用Netbeans.我已经安装了所有依赖项和外部库.但是,当我尝试运行该程序时,会得到以下输出:
I'm trying to setup my development environment on Linux Mint after an unfortunate reinstall of my whole computer due to some windows troubles. For the development of the Java program I use Netbeans. I allready installed all dependencies and external libraries. However when I'm trying to run the program I get the following output:
ant -f /home/***/Documents/ebart/git/projecten/nedap/Next -Dnb.internal.action.name=run run
init:
Deleting: /home/***/Documents/ebart/git/projecten/nedap/Next/build/built-jar.properties
deps-jar:
Updating property file: /home/***/Documents/ebart/git/projecten/nedap/Next/build/built-jar.properties
compile:
run:
Error: Could not find or load main class library
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
我已经尝试使其与openJDK,orcacle(常规)JDK,Ubuntu 15.04,Linux Mint,Netbeans 8.0.2,Netbeans 7.0 ...?1或2一起使用.但这并没有改变.谷歌也无法为我提供解决方案.
I already tried to make it work with openJDK, orcacle(normal) JDK, Ubuntu 15.04, Linux Mint, Netbeans 8.0.2, Netbeans 7.0...?1 or 2? but it doesn't make a difference. Also google couldn't provide me with a solution.
奇怪的是,我的主类叫做下一个",我很确定自己选择了正确的主类(com.bata.ebart.next.Next).我想它与Java无法找到其主要库有关( http://en.wikipedia.org /wiki/Java_Class_Library ),但我不确定.我也不喜欢那个,因此我不知道该怎么做.
The strange thing is that my main class is called "Next" and I'm fairly sure that I selected the right Main Class (com.bata.ebart.next.Next). I suppose it has something to do with that java cannot find its main libraries(http://en.wikipedia.org/wiki/Java_Class_Library) but I'm not sure about that. Also I am not into that and therefore I have no clue what to do.
有人知道如何解决此问题或在正确的方向帮助我吗?
Does someone know how to solve this issue or help me in the right direction?
而解决方案位于VM Options
中.我已经添加了VM Option -Djava library path="/usr/lib/jni/"
来使librxtx-java正常工作(根据这篇文章 ).删除此VM选项解决了我的问题.我尚未测试我是否仍然可以连接到串行设备(这是我使用librxtx-java的原因),因为我的串口设备不在这里.
And the solution lays in a VM Options
. I already added the VM Option -Djava library path="/usr/lib/jni/"
to make librxtx-java work (according to this post). Removing this VM Options fixed my problem. I haven't tested if I still can connect to my serial device (the reason why I'm using librxtx-java) because I don't have my serial device over here.