Research breakthrough possible @S-Logix

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • +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