0
votes

I am trying to use the Digraph.class file contained in algs4.jar but am getting the "cannot be resolved to a type" error as shown below. I have added algs4.jar to the buildpath by right clicking > Build Path > Add to Build Path. I have tried restarting eclipse and using Project > Clean...

Any ideas what I'm doing wrong?

screenshot

2
Are you sure that jar exists in your_project > Java Build Path >Libraries part ? - Semih Eker

2 Answers

0
votes

Since you did not specify your application type and IDE.. I will tell you for web project in eclipse. Go to Project>>Right CLick>>Click Properties>>Click On Deployment Assemply>>Click Add. Here add your required jar file and click apply.

Hope this works!

0
votes

In Eclipse right click on the project and expand Build Path-->Configure Build path. Select Libraries-->Click on Add External Libraries and select the lib that you want to import. Hope this works.