Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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. :)