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 trialMichael Walters
5,850 PointsI found a problem with the instructions in the Spark video 'Meet Spark'.
I'm using IntelliJ Ultimate 2016.2. In this video, the IntelliJ screen when creating a new project has changed. There is a new box that is ticked by default: 'Create separate module per source set'. If you don't untick it, IntelliJ won't compile the Spark project and error, saying the version is wrong.
If you untick that box, everything works again.
3 Answers
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsWell it should work both ways, I don't know how does unticking can break project.
If you leave option 'Create separate module per source set' ticked, nothing bad will happen.
Some people don't like it, for example here
There you also can see the difference what will happen if you turn it on or off.
But it does not break project.
You are creating a new project. And this option just changes the way Intellijidea treats modules, it does not break anything.
Michael Walters
5,850 PointsI don't know, man – I tick it, I get the error, I untick it, I don't get the error. It's repeatable. Someone else might run into the same problem, so I thought I'd better put it in here for reference, if nothing else.
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsOk. I believe you.
Just for a reference, could you paste complete Error, I believe Gradle error ?
Michael Walters
5,850 PointsThe error is: Error:java: javacTask: source release 1.8 requires target release 1.8
When you leave 'Create separate module per source set' checked, if you open Preferences > Build, Execution, Deployment > Compiler > Java Compiler, the version per module is set to 1.6 or lower. That causes the error.
But, if you don't check it, IntelliJ doesn't set versions per module, and the release error doesn't happen.
I definitely think it's useful to log this somewhere - it's a simple fix if you know where to look. Unless you can see something else I'm missing...?
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsYou can also fix this error by replacing following line from Gradle:
sourceCompatibility = 1.5
With
sourceCompatibility = 1.8
Or you can simply delete sourceCompatibility
line at all, will work just fine as well.
Refresh Gradle project and you'll be just fine.
Take a look at question here
But your solution is interesting too!