Is there a single-line or some extremely easy-to-use tool for creating service cans?

I would like to show other people how to create banks from their code so that they can share them with others. In the meantime, I would like to make it as easy as possible for them.

What would be the easiest way to do this?

+3
source share
6 answers

I get the impression that banks are just .zip files. Thus, you just need to put your classes and manifest in the right folders and use a utility like zip to pin them in the final .jar file.

+2
source

jar? . , , :

jar cf archive.jar *.class

:

jar cmf ManifestFile archive.jar *.class

, man- .

, , IDE (, Eclipse) JAR-. . , .

+2

:

jar cvf myapp.jar *
+1

jar ( ). (ant, apb ..)

, . , javac -d <directory> <source classes>

, :

javac -d ./classes ./src/mypkg/*.java

classes .

jar jarfile:

jar cvf my-jar.jar ./classes

cvf " ", , jar. , jar , , jar ( my-jar.jar).

jar ( , Java) Java

+1

Mavenize , :

$ mvn package

, deploy (, Nexus). .

+1

Eclipse 3.5, , Export → Java → Runnable jar.

jar, , , java -jar...., MANIFEST.MF .

+1

Source: https://habr.com/ru/post/1721552/


All Articles