Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make jar file from commandline in ubuntu

I am kinda stuck. Usually I use the export option in eclipse to create a 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 it uses couple of jars

foobar.jar foo_bar.jar

Now,so main is in foo.java

How do i create an executable jar.

Thanks,

like image 913
frazman Avatar asked Feb 16 '23 17:02

frazman


1 Answers

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
like image 76
Mark T Avatar answered Feb 18 '23 05:02

Mark T