You need to write a META-INF/MANIFEST.MF
file for this; the file should sit within the jar file you're distributing (i.e., the one that people use with java -jar
). Here's an example for a recent "project" I wrote:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 11.3-b02 (Sun Microsystems Inc.)
Main-Class: com.hedgee.simonsays.Main
Class-Path: lib/libthrift.jar
The main fields to care about are Main-Class
(which specifies which class to look for your main
method), and Class-Path
(which specifies the external jar files you're using).