When I click the Run Buttton in IntelliJ on a main class, it runs the gradle build with all the tasks.
However, I do not have a task that specifically runs the program (Main.main
) (no gradle run
functionality). How can I mimic that call to Main.main
through the terminal without modifying the build.gradle (like how IntelliJ is doing)?
CodePudding user response:
IntelliJ IDEA generates a Gradle script to run it. You can't do it from the terminal in the same way IntelliJ IDEA does.
You can disable Gradle delegation to run directly via the IDE.
CodePudding user response:
You should build a project without gradle to do this.
Select new project -> Java -> Intellij -> Add sample code
Tested in Intellij 2022.2