How to create a Java Jar Library from your Source code

RSDevX
2 min readMar 3, 2022

--

This tutorial deals with a library JAR, If you are looking on how to create an executable JAR check this.

Hey in the above video tutorial,

we will learn,

How to compile 2 java source files into a jar library which then you can use with your own custom codes.

We first create two Java classes Serial.java and DBaccess.java which has a couple of dummy methods.

The code is then compiled and then the resulting classes are incorporated into a jar library.

creating a jar libray

In the next section we create a Custom java code that uses the classes inside the Jar Library we created.

The tutorial teaches the user

  • How to package your classes into a JAR Library using JAR utlity of JDK or GraalVM.
  • How to access the classes inside a JAR library from your Java program
  • How to compile /link a JAR library with your custom program
  • How to configure ClassPath to access a JAR Library

--

--

No responses yet