[英]Eclipse Java project can't run with some strange errors
大家好,當我嘗試運行一個開源項目時,遇到以下錯誤,請避免這些錯誤,
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)
Unresolved compilation problems
意味着在Eclipse中有兩件事可能出錯:
1)您的src文件夾未標記為源文件夾
轉到“項目”>“屬性”>“ Java構建路徑”>“源”,然后添加源文件夾
2)您有一些從項目引用的jar文件,這些jar文件在項目中不存在或不在類路徑中。
轉到“項目”>“屬性”>“ Java構建路徑”>“庫”並添加jar文件(如果您有jar)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.