Nemos
Nemos

Reputation: 193

How to import Gradle Projects in IntelliJ?

I used libGDX for an longer time and now after an reinstallation I want to use it with Gradle.

I downloaded the setup.jar and created an project with it like described here. I imported that into IntelliJ and setted for the core Package the dependency to graddle_wrapper and for the 2nd Package "desktop" to core. I run build.gradle, without problems.

But still, IntelliJ is not able to recognise the libGDX Packages - they are red.

What do I have todo else in order to get libGDX running? (Or any other Project with Gradle)

Upvotes: 16

Views: 47944

Answers (3)

Sambalinski Johnny
Sambalinski Johnny

Reputation: 49

Current for 2024:

  1. Right-click on the build.gradle file
  2. Click on "Link Gradle Project"

Link Gradle Project Instructions

Upvotes: 1

velocity
velocity

Reputation: 2086

check out this link https://www.jetbrains.com/help/idea/import-project-or-module-wizard.html

Summary :

  1. open Intellij Idea Welcome Page
  2. press Ctrl + Shift + A
    a search Field will show up
  3. type from existing sources
    select the item import project from existing sources
  4. a message saying 'load groovy project' will show up in Intellij Idea, click on it to load the project as a groovy project

Upvotes: 1

dimoniy
dimoniy

Reputation: 5995

Do an Import Project or Open... and navigate to build.gradle file. This should be enough for IntelliJ to figure out the dependencies and set up the project.

Upvotes: 25

Related Questions