You can create your run configuration for each main class from Run -> Edit configuration
.
Here's the guide link
Editing answer because of comments below:
See this link: imgur.com/a/1H5Xhj8 Here I ran class A and B and I can see in run config menu. Now I created class JJ. I still can see green triangles on this class but not in dropdown. NB: I'm not using ultimate version but community edition. Hope it's not an issue
See, you can also run your public static void main
directly like in eclipse. IntelliJ automatically have this run config. But to have this all you need to do is set your source folder.
So, File> Project Structure > Modules
, the select src
and mark as sources
.
For more details : https://www.jetbrains.com/help/idea/creating-and-managing-modules.html
After you have done this, you will see small green triangles on left near your public static void main
from where you can run and debug.
You see that J
small icon on top of Java icons files in project window on left. This is indication that you have not configured your sources folder .
See : What does this symbol mean in IntelliJ? (red circle on bottom-left corner of file name, with 'J' in it)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.