Creating a JAR file with Eclipse
- Choose the Java file from Project Explorer or Navigator view.
- Right-click (the contextual menu will be shown) and choose “Export”.
- Choose Java -> JAR file.
- Select the destination folder, for example C:\openkm-dev\jar\your-class.jar.
- Click Next.
- Click Next.
- Optional step. If your Java class implements “public static void main(String[] args)” , then you must choose your Java class as the entry point.
- Click Finish.
Images
Section titled “Images”Select the file to be exported as a JAR. Right-click and select “Export” option.

Select “.jar” file option and click on the “Next” button.

Select the “Java classes to be included” in the JAR file and click on the “Next” button.

Click the “Next” button.

Select the “Main class” and click on the “Finish” button.

Sample JAR file
Section titled “Sample JAR file”Requisites:
- Must implement the class “public static void main(String[] args)”.
package com.openkm;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
public class Test { private static Logger log = LoggerFactory.getLogger(Test.class);
public static void main(String[] args) { System.out.println("Test sample"); }}