简体   繁体   English

使用Netbeans中的特定源代码构建和清理

[英]Build and clean with specific source code in Netbeans

I have a project with four packages. 我有一个包含四个包的项目。 One of them has the same name as the project (to lower case) and within a source code with the main method. 其中一个与项目(小写)的名称相同,并且在main方法的源代码中。

When i click build and clean I generate a ".jar" which starts the main method with this source code. 当我单击构建并清理时,我生成一个“.jar”,它使用此源代码启动main方法。 I have another source code in another package of the project, i can click on it and run but i don't know how to build and clean from this source. 我在项目的另一个包中有另一个源代码,我可以点击它并运行但我不知道如何从这个源构建和清理。

Do you know how to do this? 你知道怎么做吗?

The code from all the packages are included in that jar which is build from the project. 所有包中的代码都包含在从项目构建的jar中。 But of course by default it can only run one of the main methods. 但是当然默认情况下它只能运行一种主要方法。

If you want to start another one call 如果你想开始另一个电话

java -jar JAR-name your.onotherpackage.with.Main

Go to Project properties > Run > Main Class: 转到项目属性>运行>主类:

When I clicked on build and clean I got a .jar with the main method i wanted. 当我点击构建和清理时,我得到了一个.jar ,我想要的主要方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM