我一直在尝试在NetBeans上运行一个简单的程序,但在碰到RUN之后,我收到一个消息框,其中-一个或多个项目编译时出错。应用程序可能意外结束。
当我“无论如何都运行”时,我将获得程序的期望输出,但是如果取消它,则会在“输出” Pane 中得到此错误-



当我点击错误时,我被带到

        <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />

在run.xml文件上的一行。

我的代码是:
public class minitest {
    public static void main(String[] args) {
        Connect conn=null;
         try{
        Domain testDomain=conn.domainLookupByName("test");
        System.out.println("Domain:" + testDomain.getName() + " id " +
                           testDomain.getID() + " running "
                           );
        } catch (LibvirtException e){
        System.out.println("exception caught:"+e);
        System.out.println(e.getError());
        }
        }
        } }

谢谢!

最佳答案

似乎您在类路径中没有所有项目所需的库...

您是否已验证类路径?例如,您使用libvirt,项目类路径中是否有libvirt jar?

关于java - 编译时出现一个或多个错误的NetBeans项目,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8018868/

10-11 22:26
查看更多