简体   繁体   English

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

[英]Eclipse Java project can't run with some strange errors

Hi all I am getting the following errors when I've tried to run an open source project, any idea to avoid these 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

Means two things can go wrong in Eclipse: 意味着在Eclipse中有两件事可能出错:

1) Your src folder is not marked as source folder 1)您的src文件夹未标记为源文件夹

Go to Project>Properties>Java Build Path>Source and add the source folder 转到“项目”>“属性”>“ Java构建路径”>“源”,然后添加源文件夹

2) You have some jar files referenced from your project which either is not present in the project or is not in you classpath. 2)您有一些从项目引用的jar文件,这些jar文件在项目中不存在或不在类路径中。

Go to Project>Properties>Java Build Path>Libraries and add the jar files (in case you have the jars) 转到“项目”>“属性”>“ Java构建路径”>“库”并添加jar文件(如果您有jar)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM