"Unable to start compilation: output path not specified for module ..."

I have a very simple Java + Gradle project. He builds great. It works fine with the shell using the "gradle run". However, if I try to start 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 the path to compiling the project." I don't want a custom output path, no matter what it is, just follow the normal Gradle layout and run.

+88
java intellij-idea intellij-13 gradle
May 15 '14 at 21:10
source share
10 answers

You just need to go to Module settings > Project and select “Exit the project compiler” and make your modules inherited from the project. (To do this, go to Modules > Paths > Inherit project .

It helped me.

+86
Aug 05 '15 at 2:32
source share

You must specify the path in the output field of the project compiler in

File > Project Structure... > Project > Project compiler output

This path will be used to store all project compilation results.

+84
Nov 18 '16 at 10:50
source share

When setting up the idea plugin in gradle, you must define the output directories as follows.

 idea{ module{ inheritOutputDirs = false outputDir = compileJava.destinationDir testOutputDir = compileTestJava.destinationDir } } 
+10
Jul 01 '14 at 10:13
source share

I answer this so that I can find a solution when I have to google this error again.

Set the compilation output path of the path_of_the_project_folder/out project. This is what works today. The intellj documentation gives the impression that we can select any folder, but it is not.

+6
Jan 26 '18 at 11:58
source share

If none of the above methods worked, try it, it worked for me.

Go to "File"> "Project Structure"> "Project", and then in the "Project Compiler Output" click three dots and specify the path to your project name (file name), then click "Apply" and then "OK" .

It should be like in the picture.

+5
Aug 16 '18 at 12:35
source share

Open the .iml file. Find the keyword 'NewModuleRootManager'. Check if the attribute 'inherit-compiler-output' is set to true or not. If not set to true.

Like this:

 component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" /> 
+3
Jan 6 '16 at 8:58
source share

Two things to do:

  1. Project Settings> Project Compiler Output > Set it as "Project Path (actual project path)" + "\ out".

  2. Project Settings> Module> Path> Select " Inherit Project Compilation Path "

+3
06 Oct '18 at 2:38
source share

None of the suggestions worked for me until I ran the command "gradle cleanIdeaModule ideaModule" here: https://docs.gradle.org/current/userguide/idea_plugin.html

0
Mar 10 '16 at 14:49
source share

edit drop-down list to start your project file

enter image description here

0
May 07 '19 at 9:34 am
source share

I also get this error when creating a project in IntelliJ without using a template.

I have 2 SDKs installed: Amazon Corretto and Java version 11.0.4 and this is what I do when I get this error: “change SDK”, it usually works fine with Corretto

to do this, you need to click File (in IntelliJ) / Project Structure / Project / Project SDK: select corretto from the drop-down list (or check the box on your computer) as shown here

I hope this will work for you too

Best, Constantin

0
Aug 22 '19 at 8:56
source share



All Articles