简体   繁体   中英

How to create jar file from project located in separate folders?

I write a project that locate in 3 separate folder :

  1. Operator interface(d:\\operatorAPI)
  2. Main part of my program(d:\\project.main.FileProcess)
  3. four operator classes Plus , Minus , Multiply , Divide (d:\\operators).

This folders has dependencies for example :class Plus , Minus , Divide , Multiply implement Operator interface, in main program I load classes in operators dynamically and so on.

Now I want to create a Jar file from operatorAPI and my main program (the out put should be two jar files: operatorAPI & project.main.FileProcess and operators folder)

Can anyone help me?

You can do this Using Command prompt.

Suppose your file location is D:/Java/Someproject

Go to command prompt and type the location of project.

`cd D/Java/Someproject`

Hit Enter

And execute the below code :

`jar cfv Someproject.jar`

C will create jar , F will transfer file to same project folder, and V will print the result in console.

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.

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