D
D
dikium2016-12-02 11:36:58
IntelliJ IDEA
dikium, 2016-12-02 11:36:58

How to set up Intellij IDEA with gradle?

Hello! Today I started to deal with gradle. Created a project with gradle init, imported this project into intellij IDEA. I have a simple Java application written in JavaFX. The problem is that after redesigning the project in gradle, the syntax of java files stopped highlighting for me and auto-completion does not work. The development environment looks like this:
7a9a86f6b2d44d87881318108e1d923a.png
Also, the icons of the java files have changed to some strange ones ...
What did I do wrong and how to return the syntax highlighting? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dikium, 2016-12-02
@dikium

The problem was solved by reconfiguring the paths in the project settings on the modules tab.

E
Evgeny Shklyaev, 2017-03-03
@lolchtoo

Attach your Build.gradle file. I'll show you how to do it. Or add this code to your config file.

sourceSets {
    main.java.srcDirs = ['src']
    main.resources.srcDirs = ['src']
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question