How can I disable IntelliJ using the Gradle run task to run my code?

Viewed 5098

After updating IDEA, every time I debug a class in a new project only, it seems to be using the Gradle run task to run my code (despite using an "Application" run configuration, not "Gradle"!):

6:40:27 AM: Executing task 'Test.main()'...

Connected to the target VM, address: '127.0.0.1:49580', transport: 'socket'
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
Connected to the VM started by ':Test.main()' (localhost:49597). Open the debugger session tab

> Task :Test.main()
test

This is causing me many problems.

If I run tasks in an old project, it will just compile and run the code directly, without using Gradle. I compared all the settings in the two run configurations, and they're identical.

How can I disable this and prevent IntelliJ from creating this kind of run configuration when I just want a regular run configuration?

1 Answers

In IntelliJ-IDEA 2019 the option was moved directly to Gradle Settings (Build, Execution, Deployment -> Build Tools -> Gradle):

Run tests using: Gradle / IntelliJ IDEA

intellij gradle settings screen clip

Related