2.3. Java programs

Programs must have one or more executables in one or more of the directories defined by 9.1 of the Debian Policy. These must either be a wrapper script or a symlink to an executable jar. In any case, they must run without specific environment variables (see Policy 10.9), for instance CLASSPATH. They must respect the Policy rules for executables (for instance a manual page per executable, see Policy 13.1).

If the package installs a jar (or a symlink to a jar) as an executable the package must have an absolute dependency on jarwrapper or an equivalent package, which allows jar files to be executed directly from PATH like a normal program. The package must also ensure that the correct class is used as main-class. As an example jarwrapper uses the Main-Class attribute from the main part of the Manifest of the jar file to determine this.

Additional classes in the package must be packaged in one or more JARs which can be put into /usr/share/java (if they are intended to be used by other programs) or into a private directory in /usr/share/<package>.

Programs must depend on the needed runtime environment (default-jre or default-jre-headless if need a GUI or not, and java<N>-runtime or java<N>-runtime-headless as provided by alternative Java environments).

There is no naming rules for programs, they are ordinary programs, from the user point of view.