Run IntelliJ Java main method without Gradle build

If you have a Gradle project in Idea IntelliJ IDE and you want to run a simple Java class with the main method just like a standalone java application without Gradle kicking off the build process (can take up a lot of time when you are having multi-project dependencies), follow the below steps,

  1. Go to Menu: View -> Tool Windows -> Gradle,
    View - Tool Window - Gradle Option
  2. Now, Click on the gear icon and select: Gradle Settings..
    Gradle Settings
  3. Now under Build and run select Build and run using IntelliJ IDEA instead of Gradle (default)
    Build and run using IntelliJ IDEA

Now when you will run your Java main method the Gradle build will not happen and your execution will be super quick!

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap