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

Development Tools

Micah Murray
Micah Murray
6,913 Points

I'm having a problem where IntelliJ cannot resolve imports even though the libraries are added to the project. Thanks.

I'm having a problem where IntelliJ cannot resolve imports even though the libraries are added to the project. It seems like its a problem with intellij itself but I don't know what. I'm new to intellij.

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

If you are creating Gragle project, then Open Gradle Tool window:

https://www.jetbrains.com/help/idea/2016.2/gradle-tool-window.html

  1. usually if libraries cannot be loaded, then you'll squiggly lines under libraries that were not imported.

  2. Also post here your Gradle file: build.gradle.

  3. But the very best option would be to share project on GitHub, if you know how, so that anyone can take a look at your project files:

https://www.jetbrains.com/help/idea/2016.2/share-project-on-github-dialog.html

At last posting a screenshot here: well post it on the web somewhere, and share a link here, so that anyone can take a look could be one more option...

Micah Murray
Micah Murray
6,913 Points

The project was downloaded from GitHub and I wasn't able to resolve the problem with IntelliJ so I created a new project and copy the content of the downloaded project into it.

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Let me tell you how I do it with project from GitHub, when for example, I want to import project, let it be "Giflib from Spring Basics Course" here at Treehouse:

https://github.com/treehouse-projects/giflib

Here are my steps:

  1. Go to some directory I want my project to be
  2. type git clone https://github.com/treehouse-projects/giflib to this directory
  3. Open Intellijdea
  4. File -> New -> Project From Existing Sources ->
  5. Pick up dir where I cloned from git
  6. In 'Import Project' window I pick 'Import project from external model' and 'Gradle', if it is Gradle project
  7. Leave defaults in next Import Project window
  8. Click finish, and here I have a project imported.