Skip to content

Creating a JAR file with Eclipse

  1. Choose the Java file from Project Explorer or Navigator view.
  2. Right-click (a contextual menu will be shown) and choose “export”.
  3. Choose Java -> JAR file.
  4. Select the destination folder, for example C:\openkm-dev\jar\your-class.jar.
  5. Click Next.
  6. Click Next.
  7. Optional step. If your Java class implements “public static void main(String[] args)”, then you must choose your Java class as the entry point.
  8. Click Finish.

Select the file to be exported as a JAR. Right-click and select the “export” option.

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

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

Click the “Next” button.

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

Requisites:

  • Must implement the method “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");
}
}