[英]Run multiple classes with netbeans maven project
I have one Maven project in Netbeans, which has several classes, which contain a main method. 我在Netbeans中有一个Maven项目,该项目有几个类,其中包含一个主要方法。
Is there a way to run different classes with a shortcut? 有没有办法用快捷方式运行不同的类? I mean something like the different run configurations in Eclipse, which offers me a dropdown.
我的意思是像Eclipse中不同的运行配置一样,它提供了一个下拉菜单。
I found out that I can specify different main classes, if I add several configurations in NetBeans. 我发现,如果在NetBeans中添加几个配置,则可以指定不同的主类。 But for me it is not very convenient if I have to set the configuration to A and press run, set the configuration to B and press run and so on.
但是对我来说,如果必须将配置设置为A并按Run,将配置设置为B并按Run等,并不是很方便。
Well this doesn't actually answers the question in the manner you want but this could be one of the workaround solution. 好吧,这实际上并不能以您想要的方式回答问题,但这可能是解决方法之一。
link to achieve step 3. Using switch statements inside a for loop 链接以实现步骤3。 在for循环内使用switch语句
Note: Visibility of classes can be an issue. 注意:类的可见性可能是一个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.