Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to create executable jar file from the class files?


Executable jar file can be created for the set of class files. Following steps demonstrates the creation of Sorting.jar file for the class file Sorting.class.

Sample Code
  • Filename:

import java.util.*;
class Sorting {
public static void main(String args[]) {
//Sorting Integer in natural order
int n[] = {40,20,29,65,74};
System.out.println("Sorted list of Integer");
for(int i:n) {
//Sorting String in natural order
String s[] = {"dog","cat","animal","bird","dove"};
System.out.println("Sorted list of String");
for(String i:s) {


  • Commands to be executed

To create jar file:

jar – cvfe Sorting.jar Sorting Sorting.class

To execute jar file:

java -jar Sorting.jar


Create executable jar file from the class files
Commands to be executed
To create jar file
To execute jar file