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
Getting compiler warning
Why am I getting the following warnings and how should I fix it? It seems to be referring to the build.gradle sourceCompatibility. Should I change it?
Warning:java: source value 1.5 is obsolete and will be removed in a future release Warning:java: target value 1.5 is obsolete and will be removed in a future release Warning:java: To suppress warnings about obsolete options, use -Xlint:-options.
Alexander NikiforovJava Web Development Techdegree Graduate 22,175 Points
The problem comes for a number of reasons...
But I think it is because of this
sourceCompatibility line in
build.gradle, you are right.
Short answer, set it to
For a long answers, see for example here
Why It didn't come when Chris did the video
The reason why Chris didn't have that error, comes from the fact that he used older versions of Intellijdea, and there IDE was NOT creating 'Separate Modules Per Set':
Right now you are using new Intellijdea, and by default the checkbox 'Create separate modules per set' is checked. (see screenshot above).
That is why this
sourceCompatibilty = 1.5 throws this warning at you.
sourceCompatiility = 1.5 to
1.8 OR remove the line completely
Close intellijdea, delete
.idea folder and re-import Gradle project once again with 'Create separate modules per set' unchecked.