One thing that I miss from Eclipse is that I can't run code for testing various things (think short main()) if some totally unrelated files in my project contain errors. I've read in FAQ that I can use Eclipse compiler with -proceedOnErrors argument but it still doesn't work. Temporarily fixing unfinished code to compile is not really what I want.
I should note that I use Scala plugin too but still majority of my code are Java files.
Run/Debug Configurations -> Your Application -> Configuration -> Before launch: Build, Activate tool window -> remove the "Build" line with the Minus symbol. That works! :) Thank You Vic!
In "Settings" --> Build, Execution, Deployment --> "Compiler" check the checkbox "Build project automatically". This will immediately show any compile errors in the project tree.
Configure error highlighting Press Ctrl+Alt+S to open the IDE settings and select Editor | Color Scheme | General. You can also configure highlighting from inspection settings: go to Editor | Inspections, click any enabled inspection, and from the Highlighting in editor list, select Edit Highlighting.
Modify your configuration to use Make, no error check
option instead of Make
.
For more information see this answer
Note that this may not be enough in your use case. Last resort is to use the solution provided by Vics answer.
Well, you can do it. The important part, of course, that the class with the main
function compiles.
There are two ways you can go:
main
function with a right click. It will fail, but IntelliJ will automagically create a temporary running configuration for this main
function. Now edit this configuration and uncheck the option to "Make before launch". Then go back to the file and launch the main
as before.main
function you'll encounter/create in this project. Edit
This answer is outdated, and @ipandzic's answer should be used
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With