Alvin567
Alvin567

Reputation: 335

Java Cannot find symbols

I have a class file Packet.class in NetBeans, however when I try to use it, I get this error:

C:\Users\goh\Desktop\Workspace\NetSim_Alvin_Oo_U1022711A\src\PFrame.java:31: error: cannot find symbol
   public Packet info = new Packet();
  symbol:   class Packet
  location: class PFrame

what could be wrong?

Upvotes: 0

Views: 388

Answers (1)

arshajii
arshajii

Reputation: 129537

You should add the Packet.class file to your build path. I believe this can be done in netbeans by right-clicking your project and selecting 'Properties'. Note that it is better, if possible, to add a jar file instead of a class file. If you have the Packet.java file you could simply add that to the source folder.

Upvotes: 1

Related Questions