“Cannot start compilation: the output path is not specified for module…”

后端 未结 12 2370
忘掉有多难
忘掉有多难 2020-12-13 08:43

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:



        
相关标签:
12条回答
  • 2020-12-13 09:03

    change drop down to start file your project

    0 讨论(0)
  • 2020-12-13 09:05

    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.

    0 讨论(0)
  • 2020-12-13 09:06

    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.

    0 讨论(0)
  • 2020-12-13 09:12

    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"

    0 讨论(0)
  • 2020-12-13 09:13

    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.

    0 讨论(0)
  • 2020-12-13 09:15

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

    I have 2 SDKs installed: Amazon Corretto and java version 11.0.4 and so, what I do when I have this error is "change the SDK" it usually works fine with Corretto

    to do that you need to click on File (in IntelliJ)/ Project Structure / Project / Project SDK: select corretto from the dropdown list (or check the option in your computer) as shown here

    hope this will work for you too

    Best, Constantin

    0 讨论(0)
提交回复
热议问题