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 trialchaim Wilmowsky
695 PointsHandlebarsTemplateEngine() not recognized by intellij. whats going on?
i get a red line saying it dosnet know what HandlebarsTemplateEngine() is. i did install it.
5 Answers
Nicholas Pretorius
18,684 PointsHi,
I had a similar problem - I did the following (Mac running IntelliJ IDEA Community 2017.1):
- Refreshed Gradle
- Restarted IntelliJ
- Restarted my Mac
- Deleted the get() declaration with the error and rewrote it from scratch
While I don't think steps 2 & 3 are necessary, deleting the original offending line and rewriting it seemed to do the trick.
Hope this helps
Carmine Sarno
19,660 PointsThe shorthand Gradle notation wasn't working for me either (IntelliJ 2017). Try commenting out the shorthand Handlebars line in build.gradle and replacing it with: compile group: 'com.sparkjava', name: 'spark-template-handlebars', version: '2.5.5'
Refresh Gradle and it should work.
Craig Dennis
Treehouse TeacherDid you refresh Gradle afterwards?
Awais Jamil
7,539 Pointsi have the error :
Could not find method compile() for arguments [com.sparkjava:spark-template-handlebars;2.3] on object of type org.gradle.api.internal............
please help
Martin Gallauner
10,808 PointsJepp have it on auto-import.
Rishi Gupta
Courses Plus Student 2,466 PointsFor some reason I had to do
import spark.template.handlebars.HandlebarsTemplateEngine;
Refreshing Gradle, restarting IntelliJ, etc didn't seem to work. This is using Intellij 2017 also.
Kevin Fernandez-Gonzalez
16,790 PointsI think this course should be updated, there is to many issues that is take the learning experience away
Jeremiah Shore
31,168 PointsJeremiah Shore
31,168 PointsRunning Windows7, IntelliJ IDEA Community 2017.1... having a similar issue; IntelliJ will not detect spark for auto-import. I've done this course before with no issues when previously using a 2015 version, so I'm not sure what's up this time. I'm running the course as a refresher to get back into the JWD Techdegree soon (hopefully).
I tried rebuilding, refreshing Gradle, etc. Also found out that sometime when I upgraded to 2017 from 2015 that my Maven plugin was disabled; came across that as part of this troubleshooting effort. I fixed that and repeated the earlier steps with no change. What's weird is I can manually type out the import statements; the libraries are synced with Gradle and are part of the project, it just won't auto-import.
Any thoughts? Craig Dennis