Ir al contenido
Otras versiones

Cargando…

Creating a JAR file with Eclipse

Esta página aún no está disponible en tu idioma.

  1. Choose the Java file from Project Explorer or Navigator view.
  2. Right-click (the 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 class of 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” to include in the JAR file and click the “Next” button.

Click the “Next” button.

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

Requisites:

  • The class 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");
}
}