Our Feeds

Friday, 22 February 2013

Ajith KP

How to Create Java Executable File (JAR)

Here guyZ,

   I'm going to explain how to create Java executable file, JAR.

First of all create a Java application and compile it to "CLASS" file.

These are the class files while I compiled my source code. Sudoku.class is main class file in this application.

Now create a text file "MANIFEST.TXT". Name of file is not matter, but content.

       Main-Class: Sudoku

Its the line you need to save in that text file. Don't forgot to leave 2 blank lines.

Next step is generating "JAR" file. JAR file is the executable file of Java.

jar -cfm Sudoku.jar MANIFEST.TXT Sudoku.class SudokuSolverUI$1.class SudokuSolverUI$NumericalDocument.class SudokuSolverUI.class

jar -cfm -> Java command for create Jar file.
Next input must be "MANIFEST" file,ie, MANIFEST.TXT. The input every class file's names.


 Yes. We have generated Jar file successfully. Screenshot will show a Sudoku.jar.

Main advantage of JAR file is, we can give any name to JAR file. But we can't change name of CLASS file.





Here screenshot of successful execution of JAR File.

Download this application : http://code.google.com/p/sudoku-auto-solver/

You needed Java RunTime Environment(JRE) for run this app.

<<<<<<<<<<<<<<<<<<< AJITH KP & JHELAI SHADEVAN >>>>>>>>>>>>>>>>


1 comments :

Write comments
Anonymous
AUTHOR
16 May 2013 at 19:38 delete

big thank brother

Reply
avatar