<p>Whoops, forgot to reply-all.<br /><br />-------- Original Message --------</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th align="right" valign="baseline">Subject: </th>
<td>Re: A More FHS-Compliant JDK Install</td>
</tr>
<tr>
<th align="right" valign="baseline">Date: </th>
<td>Sun, 02 Jan 2011 17:06:44 -0800</td>
</tr>
<tr>
<th align="right" valign="baseline">From: </th>
<td>Shea Levy <shea@shealevy.com></td>
</tr>
<tr>
<th align="right" valign="baseline">To: </th>
<td>"Lussier, Denis" <denisl@openscg.com></td>
</tr>
</tbody>
</table>
<p> </p>
<!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<p>Hi Luss,</p>
<p>My understanding (based on similar reasoning to the section of <a href="http://lists.netisland.net/archives/plug/plug-2006-01/msg00132.html">http://lists.netisland.net/archives/plug/plug-2006-01/msg00132.html</a> which starts "I recall a standard on this that I once read.") is that /opt is is better suited for binary distributions and /usr(/local) is more appropriate for packages built on the system. Additionally, installing in /usr(/local) means no need to change $PATH, no need to add custom directories for linkers to look for, and probably (eventually) no need for env variables like $JAVA_HOME. I may be completely off-base here, though, I'm far from an expert in file system standards (though if I'm wrong, I have no idea what differentiates /opt and /usr).</p>
<p>Cheers,<br /> Shea</p>
<p>On Sun, 2 Jan 2011 19:55:53 -0500, "Lussier, Denis"  wrote:</p>
<blockquote style="padding-left: 5px; border-left: 2px solid #1010ff; margin-left: 5px; width: 100%;">
<p>Hi Shea,</p>
<div>I am sorry for my ignorance, but... why is /opt not an appropriate location for OpenJDK??</div>
<div>OpenSCG's installer binaries for OpenJDK 6 are built on CentOS 4, install in a directory under /opt (when installed as root).  They seem to work fine in all the modern Linux Distro's without doing anything funky/extra with LIB files.</div>
<div>I believe this is similar to how Oracle builds their commercial JDK bu ilds, but, perhaps I am naive. :-)</div>
<div>--Luss</div>
<div>  <a href="http://openscg.org">http://openscg.org</a><br /><br />
<div class="gmail_quote">On Sun, Jan 2, 2011 at 6:17 PM, Shea Levy <span><<a href="mailto:shea@shealevy.com">shea@shealevy.com</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0   0   0   .8ex; border-left: 1px   #ccc   solid; padding-left: 1ex;">
<p>Hi all,</p>
<p>I've just successfully built openjdk6, and am wondering  about the best way to install it on my system, given that the /opt  prefix is no longer obviously appropriate for the build. I have an  install that works for now, but there are aspects I'm unhappy with. I am  on a Linux From Scratch system, so I install everything into /usr (<a href="http://www.linuxfromscratch.org/blfs/view/svn/introduction/position.html">http://www.linuxfromscratch.org/blfs/view/svn/introduction/position.html</a>), but everything that follows should apply to /usr/local.</p>
<p>My set up for now:</p>
<p>I've copied build/linux-i586/bin/* to /usr/bin. No problems there.</p>
<p>I've  copied build/linux-i586/lib/* to /usr/lib, but upon review I think it  probably belongs in a separate /usr/lib/java/ since there aren't any .so  files in the base of build/linux-1586/lib. If I try that, running /usr/bin/java complains of being unable to find libjli.so</p>
<p>I've copied build/linux-i586/classes/ to /usr. This is the most  disconcerting, as I'd rather not add to the root of /usr and these files  seem perfectly suited to fit in /usr/lib/java. If I try moving it  there, running /usr/bin/java complains of having no class definition for  Object.</p>
<p>I've copied build/linux-i586/j2sdk-image/man/man1/* to  /usr/share/man/man1. No problems there, though it would be nice if there  were a share directory in build/linux-i586/</p>
<p>I've copied build/linux-i586/include/* to /usr/include/java. No problems there.</p>
<p>I've copied build/linux-i586/docs/* to /usr/share/doc/openjdk-6-20b</p>
<p>Output of ldd /usr/bin/java:</p>
<p>linux-gate.so.1 =>  (0xb77b6000)<br /> libpthread.so.0 => /lib/libpthread.so.0 (0xb7793000)<br /> libjli.so => /usr/bin/../lib/i386/jli/libjli.so (0xb778a000)<br /> libdl.so.2 => /lib/libdl.so.2 (0xb7786000)<br /> libc.so.6 => /lib/libc.so.6 (0xb7626000)<br /> /lib/ld-linux.so.2 (0xb77b7000)</p>
<p>System.getProperty("sun.boot.class.path"):</p>
<p>/usr/lib/resources.jar:/usr/lib/rt.jar:/usr/lib/sunrsasign.jar:/usr/lib/jsse.jar:/usr/lib/jce.jar:/usr/lib/charsets.jar:/usr/classes</p>
<p>1. Am I missing any important files if that's all I bring over from build/linux-i586/ ?</p>
<p>2. Am I right that some of these file locations aren't the most appropriate given Linux standards?</p>
<p>3.  For build/linux-i586/lib: I could manually relink all of the relevant  binaries to the new library locations. Would there be any problems aside  from linking in moving those files to /usr/lib/java? Is there a better  way than manual relinking to specify that those files lie in a different  directory (e.g. some sort of ALT env variable, or a simple modification  to a Makefile?)</p>
<p>3. For build/linux-i586/classes: I could globally  alias java to java -Xbootclasspath:whatever, but that's ugly. I'm  pretty sure there has to be some Makefile I could edit to change the  built in bootclasspath, since build/linux-i586/j2sdk-image/bin/java  looks in ../jre/classes, but I'm not sure where to start looking. What  Makefile would I need to modify? Or is there an env variable I could  set?</p>
<p>4. In general, are there plans to autotool the build or add an install target to the main Makefile?</p>
<p>Cheers,</p>
<p>Shea Levy</p>
</blockquote>
</div>
</div>
</blockquote>
<p> </p>