简体   繁体   中英

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:

1) Your src folder is not marked as source folder

Go to Project>Properties>Java Build Path>Source and add the source folder

2) You have some jar files referenced from your project which either is not present in the project or is not in you classpath.

Go to Project>Properties>Java Build Path>Libraries and add the jar files (in case you have the jars)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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