Java – enables NetBeans (ANT) to generate multiple jar files for a project

I have a NetBeans project with two main classes. One starts a client and the other starts a server

I need to create two jar files to wrap two exe files, one for the client and one for the server. What should I do?

thank you.

Note: I use ants

Solution

You have two choices:

First, you can override the project's build XML to create two jar files NetBeans online help explains how to do this This chapter is named "ant script generated by custom ide"

But I recommend creating a different project for each executable

It is likely that the server and client are using some common code, so you will use three different projects in NetBeans:

>Myapp common – contains all classes used by the server and client > myapp server – contains all contents required by the server, takes the item "myapp common" as the Library > myapp client – contains all contents required by the client, and takes the item "myapp common" as the library

Then, when you build a client or server project, each will generate a separate jar file

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>