Eclipse Java项目无法运行时出现一些奇怪的错误

时间:2014-05-21 11:33:45

标签: java

大家好我在尝试运行开源项目时遇到以下错误,任何想法都可以避免这些错误,

Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems: 
    The import net cannot be resolved
    The import net cannot be resolved
    The import net cannot be resolved
    PacketSource cannot be resolved to a type
    PacketSource cannot be resolved to a type
    BuildSource cannot be resolved
    PacketSource cannot be resolved to a type
    PacketSource cannot be resolved to a type
    PrintStreamMessenger cannot be resolved to a variable
    PacketSource cannot be resolved to a type
    PacketSource cannot be resolved to a type
    PacketSource cannot be resolved to a type
    PrintStreamMessenger cannot be resolved to a variable
    PacketSource cannot be resolved to a type

    at Classes.snifferImpl.<init>(snifferImpl.java:32)
    at Classes.Zmonitor$1$1.run(Zmonitor.java:86)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

1 个答案:

答案 0 :(得分:0)

Unresolved compilation problems

意味着Eclipse中可能出现两件事:

1)您的src文件夹未标记为源文件夹

  

转到项目&gt;属性&gt; Java构建路径&gt;源并添加源   夹

2)你有一些从你的项目引用的jar文件,它们不在项目中,或者不在你的类路径中。

  

转到项目&gt;属性&gt; Java构建路径&gt;库并添加jar   文件(如果你有罐子)