<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Java libraries</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Debian policy for Java"
HREF="index.html"><LINK
REL="UP"
TITLE="Policy"
HREF="c43.html"><LINK
REL="PREVIOUS"
TITLE="Java programs"
HREF="x85.html"><LINK
REL="NEXT"
TITLE="Native Java Bytecode (gcj packages)"
HREF="x145.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Debian policy for Java</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x85.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. Policy</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x145.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="policy-libraries"
>2.3. Java libraries</A
></H1
><P
>&#13;	Libraries are not separated between developers (-dev) and users
	versions, since this is meaningless in Java.
      </P
><P
>&#13;	Java libraries packages <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be named libXXX[version]-java
	(without the brackets), where the version part is optional and <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
>
	only contain the necessary part. The version part <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> only be
	used to avoid naming collisions. The XXX part is the actual package
	name used in the text below.
      </P
><P
>&#13;	Their classes <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be in <TT
CLASS="filename"
>jar</TT
> archive(s) in
	the directory <TT
CLASS="filename"
>/usr/share/java</TT
>, with the name
	<TT
CLASS="filename"
>packagename[-extraname]-fullversion.jar</TT
>.
	The extraname is optional and used internally within the package to
	separate the different jars provided by the package. The fullversion
	is the version of that jar file. In some cases that is not the same as
	the package version.
      </P
><P
>&#13;	Some package <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> also provide a symbolic link from
	<TT
CLASS="filename"
>packagename-extraname.jar</TT
> to the most compatible
	version of the available
	<TT
CLASS="filename"
>packagename-extraname-version.jar</TT
> files.
      </P
><P
>&#13;	Class files in a java library <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be built with debug symbols.
      </P
><P
>&#13;	All jar files <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> have a well-documented CLASSPATH, so 
	that developers should know what to add to their wrappers.
      </P
><P
>&#13;	This applies only to libraries, <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>not</I
></SPAN
> to the core
	classes provided by a the runtime environment.
      </P
><P
>&#13;	Some Java libraries rely on code written in a "native" language,
	such as JNI (Java Native Interface) code.  This native code is
	compiled into separate dynamic libraries which are loaded by the
	Java virtual machine at runtime.
      </P
><P
>&#13;	If a Java library relies on native code, the dynamic libraries
	containing this compiled native code <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> be installed into
	the directory <TT
CLASS="filename"
>/usr/lib/jni</TT
>.  These dynamic
	libraries <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> be shipped in a separate architecture-specific
	package named libXXX[version]-jni.  The package containing the Java
	bytecode (generally libXXX[version]-java) <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> depend on
	this package.
      </P
><P
>&#13;	There may be situations, such as with very small packages,
	where it is better to bundle the Java code and the native code
	together into a single package. Such packages <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> be
	architecture-specific and follow the usual libXXX[version]-java
	naming convention.
      </P
><P
>&#13;	Java library packages <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>should</I
></SPAN
> compile the javadoc API of the
 	library. The API <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> link against the javadoc API of the
	libraries it depends on. This includes the core java classes,
	which are provided by <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>default-jdk-doc</I
></SPAN
>. The API <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be registered with
	doc-base and <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be installed in
	<TT
CLASS="filename"
>/usr/share/doc/&#60;package&#62;/api/</TT
> or
	<TT
CLASS="filename"
>/usr/share/doc/&#60;package&#62;/api-&#60;component&#62;/</TT
>.
      </P
><P
>&#13;	The API <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> be placed in a separate doc package. This package
	<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>must</I
></SPAN
> recommend the doc packages it was linked against.
      </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x85.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x145.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Java programs</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c43.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Native Java Bytecode (gcj packages)</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>