Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Using Dependencies

Gavin Ralston
Gavin Ralston
28,770 Points

[IntelliJ import trouble] CSVPrinter not found in library it definitely appears to be in

I'm attaching a screen shot, hopefully the information is all there.

Project window shows the apache commons csv contents, including CSVPrinter

Terminal window shows results of gradlew dependencies

Gradle tab shows the same thing

Editor shows the behavior I'm getting: It won't do code completion because it can't resolve CSVPrinter, which means I also had to manually type in the import statement. That import statement shows there's zero problem importing org.apache.commons.csv.* but that's it. It throws a fit when I try to specifically import CSVPrinter

Any ideas where I might have not followed instructions properly?

1 Answer

Gavin Ralston
Gavin Ralston
28,770 Points

Answering my own question here, because maybe somebody else will have this PEBCAK problem later:

Earlier in the workshop Craig goes over having dependencies automatically update in IntelliJ rather than forcing a refresh every time. If you play with build.gradle and remove and add lines to watch the libraries disappear and reappear in your project, be sure to save all files

This way, you know, IntelliJ will exactly follow the instructions you're giving it, not the instructions you think you are. :)