Creating Jars in Java

Making Your Jars from the Command Line

Jordan Williams
Level Up Coding
Published in
5 min readFeb 12, 2021

--

“Jars of Clay” by ricky_artigas is licensed under CC BY 2.0

JAR. JAva aRchive. This is a file format that allows you to package your Java code into a single file format. This file format can be be used for storage or it can be runnable. Runnable meaning, with the click of a button it will launch your application (just like those icons on your desktop).

Having a JAR file provides a simple way for us to package our code. It comes inbuilt with compression to reduce the size of code and makes it easier to transfer code across mediums due to the file being a smaller singular one.

JARs can also store images and other files that are used within your Java code or it can only store the compiled Java code( .class/ bytecode) itself which will be used to execute your program.

In this article, we’ll show you how easy it is to create a JAR file in Java.

Note: This will be done on a windows machine.

Let’s Begin!

This is the structure of the code we’ll be working with.

We have two folders src and bin. src will contain our source code. Inside our src folder there is…

--

--

Enjoys creating software that make tasks simpler. Always trying to gain new knowledge and expertise.