Home > other >  How to run single java files independently in Intellij IDEA or vscode?
How to run single java files independently in Intellij IDEA or vscode?

Time:11-02

I need to run single java files independently in Intellij IDEA or vscode. Currently when I run a single program both IDEs checks for other files. For eg in the given image I need to run ReversingString program only but it doesnt run it and asks me to correct error in other java files. How can I run a single file while ignoring other files. I checked answers to other similar questions here like editing run configuration but nothing is working.

Please help.

I want all files in this folder to be independent/separate from each other.

Error

CodePudding user response:

To run single java independently in Intellij IDEA you've choices:

  • Right-click somewhere in the editing area and select Run 'ReversingString.main()'.
  • Open the file in editor and use Ctrl Shift F10

read the answers enter image description here

Another way:

Install the enter image description here

  • Related