java - 编译时出现一个或多个错误的NetBeans项目

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

run: /root/.netbeans/6.8/var/cache/executor-snippets/run.xml:45: Cancelled by user



当我点击错误时,我被带到
        <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?

https://stackoverflow.com/questions/8018868/

相关文章:

iphone - 编译我的应用程序没有错误,但是在设备上编译时挂起

compiler-construction - lex 使用来自 lex.yy.c 文件的 flex

objective-c - 尽管导入了正确的 header ,但使用自定义类的编译器错误

java - 复选框编译错误

java - 编译Java项目时出错

android - 在 Android 中初始化一个大的常量数据结构

compiler-errors - nant 构建文件使用 nant 0.86 而不是 0.91 a

php - 使用PHP的exec()函数(或类似函数),如何显示终端错误输出?

java - Java编译时错误: reached end of file while parsin

asp.net - 加载共享类库时出错