Creating a JAR file with Eclipse
These instructions are only a guide for creating a JAR based on a single .java file.
Take it as is, an introduction.
The following steps may need to be changed depending on any Eclipse version changes.
- Choose the Java file from Project Explorer or the Navigator view.
- Right click (to show the contextual menu) 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 class of the entry point.
- Click Finish.
Step 7 for example is needed when you're creating a new crontab job.
More information at Creating your own Crontab job.
Images
Select the file to be exported as a jar. Right click with your mouse and select the "export" option.
Select the ".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 on the "next" button.
Select the "Main class" and click on the "Finish" button.
If your JAVA class implements "public static void main(String[] args)" then you must choose your java Main class as the class of the entry point, otherwise you can skip this step.