I have a very simple Java + Gradle project. It builds fine. It runs fine from the shell with "gradle run". However, if I try to run inside of IntelliJ, I get:
Cannot start compilation: the output path is not specified for module "xyz" Specify the output path in Configure Project.
My "Compiler output" is set to "Inherit project compile output path". I don't want a custom output path, whatever that is, just do a normal gradle build and run.
Open .iml file. Look for keyword 'NewModuleRootManager'. Check if attribute 'inherit-compiler-output' is set to true or not. If not set to true.
Like this :
If none of the above method worked then try this it worked for me.
Go to File > Project Structure> Project and then in Project Compiler Output click on the three dots and provide the path of your project name(name of the file) and then click on Apply and than on Ok.
It should be like that as in the picture i an posting.
You have to define a path in the "Project compiler output" field in
This path will be used to store all project compilation results.
While configuring idea plugin in gradle, you should define output directories as follows.
None of the suggestions worked for me until I ran the command "gradle cleanIdeaModule ideaModule" info here: https://docs.gradle.org/current/userguide/idea_plugin.html
Bugs caused by missing predefined folder for store compiled class file which is normally is /out folder by default. You can give a try to close Intellij > Import Project > From existing source. This will solve this problem.