0

In IntelliJ IDEA, (Gradle based Java project) how to run a specific Java class with main method without Gradle build operation?

enter image description here

Vasanth Subramanian
  • 1,040
  • 1
  • 13
  • 32
  • 1
    You may annotate the method you want to execute with @Test and then run as a "JUnit test" via the right mouse button. See https://www.vogella.com/tutorials/JUnit/article.html for a tutorial. – Stefan Feb 19 '20 at 17:10
  • Are you not able to run by right clicking and run as java program ? – Sambit Feb 19 '20 at 17:32
  • Hi Sambit, when i do right-click -> Run, the Gradle build is triggered. Updated my question with screenshot on this – Vasanth Subramanian Feb 19 '20 at 17:48
  • Check this link. https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html – Sambit Feb 19 '20 at 17:56
  • See https://stackoverflow.com/a/16784855/104891. Disable build delegation: https://i.imgur.com/HpeUaUE.png. – CrazyCoder Feb 19 '20 at 18:03

0 Answers0