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 trialBrandon Adams
10,325 PointsErrors with LocalDate
I'm getting red errors in my code on the LocalDate Classes. "Usage of API which isn't available at the configured language level", it asks if I want to mark it depreciated.
4 Answers
Seth Kroger
56,413 PointsThere's a line in your build.gradle file that says sourceCompatibility = 1.5
that needs to be removed. Delete it and refresh gradle.
Edward Poon
9,313 PointsThe above didn't work for me but what did was going to file -> project structure -> project settings -> modules and selecting giflib_main and giflib_test and setting the language to 8
Brian DuPont
30,448 PointsI had the same problem. I made sure my project SDK was 1.8 and project language level was 8, which it was. What fixed it was my build.gradle file. Like Seth Kroger suggested, I changed sourceCompatibility = 1.5 to 1.8 (also I deleted that line and that worked as well). Thanks guys
Kourosh Raeen
23,733 PointsThe LocalDate class requires Java 8. Go to Project Settings and make sure that Project SDK and Project Language Level are set to Java 8.
Brandon Adams
10,325 PointsGood idea, but I set everything to 1.8 and still having the error.
Kourosh Raeen
23,733 PointsTry rebuilding the project and see if that gets rid of the error.
Daniel Santos
34,969 PointsGood things Brandon, but what Kourosh is talking about is the a setting in the Project Structure. Go to File>Project Structure and in Project language level select "8 - Lambdas, ....".
Brandon Adams
10,325 PointsStill didn't resolve the issue, but I think you are close because it said 'source value 1.5 is obsolete' even though I have everything set on 8 and rebuilt. When I launch the server it is showing the old version of the page.
Brandon Adams
10,325 PointsBrandon Adams
10,325 PointsDeleted that line, still not working.