Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cannot start compilation: the output path is not specified for module..."

People also ask

How to specify output path in Intellij?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S . Under Project Settings, select Modules | Paths. Change the paths specified in the Output path and Test output path or select Inherit project compile output path to use the paths specified for the project.

Where should project compiler output be?

You just have to go to your Module settings > Project and specify a "Project compiler output" and make your modules inherit from project. (For that go to Modules > Paths > Inherit project . This did the trick for me.


You just have to go to your Module settings > Project and specify a "Project compiler output" and make your modules inherit from project. (For that go to Modules > Paths > Inherit project.

This did the trick for me.


You have to define a path in the "Project compiler output" field in

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

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


I'm answering this so that I can find the solution when I have to google this error again.

Set project compile output path to path_of_the_project_folder/out. That's what is working today. The intellj documentation makes it seem like we can select any folder but that's not the case.


While configuring idea plugin in gradle, you should define output directories as follows.

idea{
    module{
        inheritOutputDirs = false
        outputDir = compileJava.destinationDir
        testOutputDir = compileTestJava.destinationDir
    }
}

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.


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 :

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" />

Two things to do:

  1. Project Settings > Project compiler output > Set it as "Project path(You actual project's path)”+”\out”.

  2. Project Settings > Module > Path > Choose "Inherit project compile path"