Intellij IDEA如何运行一个类不是整个项目? [英] Intellij IDEA how to run a class not the entire project?
问题描述
是否有一种方法来运行(不仅仅编译)一个类(使用main方法),而不是像Intellij IDEA一样运行整个项目?
is there a way to run (not only compile) a single class (with a main method) instead to run the entire project as does Intellij IDEA?
,是否可以在同一个窗口中打开不同的项目,而不是在新窗口中打开它们或代替当前项目?
And, is it possible to open different projects in the same window instead to opening them in a new window or in place of the current project?
推荐答案
每个窗口只能有1个项目。但是,您可以将多个模块加载到1个项目中。每个模块可以有自己的编译器,语言或任何其他设置。
You can only have 1 project per window. However, you can load multiple modules into 1 project. Each module can have it's own compiler, language, or any other set up.
如果你右键点击类的main方法,你应该有一个选项创建MyClass运行/调试或一个选项,只是运行它而不创建启动配置。
If you right click inside the main method of your class, you should have an option to "create MyClass run/debug" or an option to just run it without creating a launch config.
这篇关于Intellij IDEA如何运行一个类不是整个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!