• Increase font size
  • Default font size
  • Decrease font size

how to create jar file

How to create jar file?

 

On the internet, there is a lot of staff, but the simplest way is as follows:

1. create file a .class file with some java code:

package cKeyEventListener;
import java.awt.event.*;
public class cKeyEventListener implements KeyListener{
}

2. put the file into directory e.g. d:\cKeyEventListener\cKeyEventListener\

3. in the command prompt run following command:

D:\cKeyEventListener>d:\install\processing-1.5.1\java\bin\javac  cKeyEventListener\cKeyEventListener.java

- javac is the java compiler and it will create a .java file from the .class file

4. in the command prompt run following command:

D:\cKeyEventListener>d:\install\processing-1.5.1\java\bin\jar cf cKeyEventListener.jar cKeyEventListener\cKeyEventListener.class

- jar command will create our simple jar library in the "d:\cKeyEventListener\" directory.

5. to use the jar library in the processing code, put the jar file in the following directory:

d:\install\processing-1.5.1\modes\java\libraries\cKeyEventListener\library\cKeyEventListener.jar

6. restart the processing and include library by:

import cKeyEventListener.*;

 

 

 

 

Add comment

No bad words.


Security code
Refresh


New articles

Contact programming-other
Read More 100 Hits
Rasco Resizer - documentation programming-other
Read More 93 Hits
Programming partners programming-other
Read More 205 Hits
Read More 436 Hits

Most read content

New articles

Contact programming-other
Read More 100 Hits
Rasco Resizer - documentation programming-other
Read More 93 Hits
Programming partners programming-other
Read More 205 Hits
Read More 436 Hits
Design by i-cons.ch / etosha-namibia.ch