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 Introduction to Functional Programming Meet Streams Collecting 3 NES Scores

java: package org.apache.commons.csv does not exist

I get this error when I import the code and try to run it. Anyone knows what's the issue?

Error:(5, 30) java: package org.apache.commons.csv does not exist
Error:(6, 30) java: package org.apache.commons.csv does not exist
Error:(7, 30) java: package org.apache.commons.csv does not exist
Error:(8, 30) java: package org.apache.commons.csv does not exist
Error:(22, 37) java: package org.apache.commons.csv does not exist
Error:(22, 1) java: static import only from classes and interfaces
Error:(26, 11) java: cannot find symbol
  symbol:   class CSVParser
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(31, 18) java: cannot find symbol
  symbol:   class CSVRecord
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(35, 31) java: cannot find symbol
  symbol:   class CSVRecord
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(39, 27) java: cannot find symbol
  symbol:   class CSVRecord
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(43, 53) java: cannot find symbol
  symbol:   class CSVRecord
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(28, 67) java: cannot find symbol
  symbol:   variable RFC4180
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(28, 12) java: cannot find symbol
  symbol:   variable CSVParser
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(45, 7) java: cannot find symbol
  symbol:   class CSVPrinter
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(45, 32) java: cannot find symbol
  symbol:   class CSVPrinter
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService
Error:(45, 48) java: cannot find symbol
  symbol:   variable CSVFormat
  location: class com.teamtreehouse.challenges.highscores.service.ScoreService

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Dinu Comendant

To make sure I understand, you are receiving this error right from the get-go? After downloading and opening in the IDE you cannot run the starter code?

Which IDE are you using?

I downloaded the code and opened in `IntelliJ IDEA' (most current version) and everything ran fine with no errors.

It does look like there are a bunch of helper files missing. When opening course files from Treehouse into an IDE, make sure your are dragging the entire folder into the IDE and not just opening a single file or sub-folder. Course files are often bundled with any plugins, extras, and code needed in multiple folders and files, so you'll need to add the entire root folder to the project.

Also, make sure you are using `IntelliJ IDEA' for best results. If you are, make sure everything is current and updated. If problems still persist, you can try downloading a fresh version of the files for the challenge.

I hope this solves your problem. Troubleshooting remotely when code is not involved is tough, so if you are still having problems, you'll need to provide as much information as you can: OS being used, IDE, Processes leading up to errors, and anything else that may be relevant.

Jason :) :dizzy:

Hey, Jason Anders Yes, I get this error right from the get-go. No, I can't run the starter code after I download it and opened, and I drag the whole file. I'm using Windows 10. I re-installed IntelliJ just a few hours ago, so I have the latest version.

  1. In the ScoreService the CSVs are red and I get asked "Add library 'Gradle:org.apache.commons:commons - csv:1.3' to classpath" https://ibb.co/fNHGzrM
  2. When I add apache 1.3 I start to get this error that Parameter 'url' must not be null https://ibb.co/zmp8q2T
  3. I tried to install the latest apache commons 1.7, but I don't know how that I ended up even worse. My Jobs code stoped working and it shows me the error 'package com.google.api.util doesn't exist'. https://ibb.co/QFcyKWs
  4. I re-installed IntelliJ but the error with google api still shows up for the Jobs code. So now, besides the initial problem with code challenge, I have issues with my Job code as well... I don't know if this relevant for the problem with the code challenge, but this is a screen of all the files https://ibb.co/MPk2N6J
Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Hey,
Sorry it hasn't been resolved for you. Java is not my 'first language' and I have very little experience with Windows (I'm a Mac boy).
It looks like you are doing things correctly, but for some reason there are still some missing critical files, probably inside the preference folders for your OS and/or IntelliJ.

Sadly, this does go beyond my expertise for Java on Windows, but I will drop a note and see if I can find someone to better assist you.

My apologies. :|

Thanks a lot Jason, what files are missing though?

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Usually, the "cannot find symbol" results from a helper file missing which has the code needed, so "which file" is not easy to answer.

One thing you could try, however, to help yourself troubleshoot, is is copy/paste the exact error (eg `"Error:(31, 18) java: cannot find symbol symbol: class CSVRecord'" into Google. Many times others have the exact issue and solutions can be found this way.

I really hope you get this solved.

I've tried that and made it worse lol Please, if you know any staff that knows how to fix this issue, I would be very grateful