How to make jar file from command line in ubuntu

I'm a little stuck. I usually use the export option in eclipse to create the jar. But now I have deployed my code in production and want to create a jar file.

So, I have two files,

foo.java which calls bar.java 

And then he uses a couple of cans

 foobar.jar foo_bar.jar 

Now, so the main thing in foo.java

How to create an executable jar.

Thanks,

+4
source share
1 answer

Here's a great article on the topic: http://manpages.ubuntu.com/manpages/dapper/man1/jar.kaffe.1.html

Basically:

  $jar cvf classes.jar Foo.class Bar.class 
+7
source

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


All Articles