how to run single class without compiling whole module?
已回答
I want to run single class which has a main method, and when i press ctrl+shift+f10 in current file, then idea will compile whole module.
my module is large, so it will take a minute or more. how to solve this?
thanks in advance!
请先登录再写评论。
In the Debug/Run Configurations there's a "Defaults" button. Make sure you
have "make before launch" disabled in the default application configuration.
Thank you very much!
Can't find this setting in 2020.3
Here's how you do it in IntelliJ IDEA 2021.2:
Arina Efremova
Hi Arina,
My name is Sebastian. I tried this option to run a simple java class with a main method in a big maven multimodule project. When I click add before launch task -> Then remove build button as you shown . It automatically checks "Do not build before run". It prevents the simple java class from building and it fails to run with latest changes as compilation for single java class is not happening. This is what I observed. Kindly suggest an alternative. It's basic stuff. It was working on older version like 2019 where run configuration interface is totally different.
TIA
Sebastian
Email : iamseban@gmail.com
Use Build | Recompile before running.
I can't see this option, Could you please share a gif or screenshot as above
While the focus in inside .java file:
It worked in this way. But it would be a much better and cleaner solution if we can do just with right click -> Run
See also https://stackoverflow.com/a/16784855/104891.
Not sure what help you need, I already provided the screenshot for this option above.
okay Thanks