docs/75636: [PATCH] Update the Porter's handbook - Java section

Herve Quiroz herve.quiroz at
Fri Dec 31 00:21:42 UTC 2004

Hi Mark,

On Thu, Dec 30, 2004 at 02:54:55PM -0600, Mark Linimon wrote:
> (Sorry, I'm barely able to keep up with email ATM due to outside
> constraints, so I'm not sure this has already been addressed.)

No problem. I assigned the PR to Greg but I'm glad you gave me feedback.
Thanks for the review.

BTW, all I know of doc/SGML stuff is what I learnt from you so I'm
always glad when you teach me a new hint ;)

>   I would suggest:
>           in <xref linkend="dads-noinstall">.</para>
> e.g. the name associated with that reference will be picked up and used.
> It will also be properly highlighted in the web-based version.
> (You have 3 instances of this in the above IIRC.)

Actually 5 :)

Hence, the new patch.


Index: book.sgml
RCS file: /var/fcvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v
retrieving revision 1.510
diff -u -r1.510 book.sgml
--- book.sgml	22 Dec 2004 23:51:15 -0000	1.510
+++ book.sgml	31 Dec 2004 00:00:03 -0000
@@ -1536,7 +1536,10 @@
 		<entry>Software related to the Java language.</entry>
-		<entry></entry>
+		<entry><filename>java</filename> shall not be the only
+		  category for a port. Porters are also encouraged not to
+		  use <filename>java</filename> as the main category of a
+		  port.</entry>
@@ -4297,7 +4300,10 @@
 		<command>jikes</command> (by setting <literal>'no'</literal>
 		or <literal>'yes'</literal>). In the later case, <filename
 		role="package">devel/jikes</filename> will be added to build
-		dependencies of the port.</entry>
+		dependencies of the port. In any case that <command>jikes</command>
+		is actually used in place of <command>javac</command>, then the
+		<makevar>HAVE_JIKES</makevar> variable is defined by
+		<filename></filename>.</entry>
@@ -4435,6 +4441,11 @@
 		JDKs used
+	    <row>
+	      <entry><makevar>HAVE_JIKES</makevar></entry>
+	      <entry>Defined whenever <command>jikes</command> is used by
+	        the port (see <makevar>USE_JIKES</makevar> above).</entry>
+	    </row>
@@ -4469,10 +4480,40 @@
+	    <row>
+	      <entry><makevar>JAVALIBDIR</makevar></entry>
+	      <entry>The directory where JAR files installed by other
+	        ports are located. Default:
+		<filename>${LOCALBASE}/share/java/classes</filename>.</entry>
+	    </row>
+      <para>The related entries are defined in both
+	<makevar>PLIST_SUB</makevar> (documented in
+	<xref linkend="porting-plist">) and
+	<makevar>SUB_LIST</makevar>.</para>
+      </sect2>
+      <sect2 id="java-building-with-ant">
+	<title>Building with Ant</title>
+	<para>When the port is to be built using Apache Ant, it has to
+	  define <makevar>USE_ANT</makevar>. Ant is thus considered to be
+	  the sub-make command. When no <literal>do-build</literal> target
+	  is defined by the port, a default one will be set that simply
+	  runs Ant according to <makevar>MAKE_ENV</makevar>,
+	  <makevar>MAKE_ARGS</makevar> and <makevar>ALL_TARGETS</makevar>.
+	  This is similar to the <makevar>USE_GMAKE</makevar> mechanism,
+	  which is documented in <xref linkend="makefile-build">.</para>
+	<para>If <command>jikes</command> is used in place of
+	  <command>javac</command> (see <makevar>USE_JIKES</makevar> in
+	  <xref linkend="java-variables">), then Ant will automatically
+	  use it to build the port.</para>
       <sect2 id="java-best-practices">
@@ -4487,7 +4528,7 @@
 	  statement (where <filename>myport.jar</filename> is the name
 	  of the JAR file installed as part of the port):</para>
-	<programlisting>PLIST_FILES+= ${JAVAJARDIR:S,^${PREFIX}/,,}/myport.jar</programlisting>
+	<programlisting>PLIST_FILES+= %%JAVAJARDIR%%/myport.jar</programlisting>
 	<para>When porting a Java application, the port usually installs
 	  everything under a single directory (including its JAR
@@ -4518,8 +4559,8 @@
 	  idea to override <makevar>DATADIR</makevar> to
 	  <filename>${JAVASHAREDIR}/${PORTNAME}</filename> for Java ports.
 	  Indeed, <makevar>DATADIR</makevar> is automatically addded to
-	  <makevar>PLIST_SUB</makevar> (documented <link
-	  linkend="porting-plist">here</link>) so you may use
+	  <makevar>PLIST_SUB</makevar> (documented in <xref
+	  linkend="porting-plist">) so you may use
 	  <literal>%%DATADIR%%</literal> directly in
@@ -4548,6 +4589,10 @@
 	  the issue you are trying to resolve is related to either a JDK
 	  implementation or <filename></filename>.</para>
+	<para>Similarly, there is a defined policy regarding the
+	  <makevar>CATEGORIES</makevar> of a Java port, which is detailed
+	  in <xref linkend="makefile-categories">.</para>

More information about the freebsd-doc mailing list