﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-flyonok-文章分类-java</title><link>http://www.cppblog.com/flyonok/category/6289.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 22 May 2008 18:58:53 GMT</lastBuildDate><pubDate>Thu, 22 May 2008 18:58:53 GMT</pubDate><ttl>60</ttl><item><title>Sun Java 6 Development Kit on F7</title><link>http://www.cppblog.com/flyonok/articles/43595.html</link><dc:creator>flyonok</dc:creator><author>flyonok</author><pubDate>Mon, 03 Mar 2008 04:36:00 GMT</pubDate><guid>http://www.cppblog.com/flyonok/articles/43595.html</guid><wfw:comment>http://www.cppblog.com/flyonok/comments/43595.html</wfw:comment><comments>http://www.cppblog.com/flyonok/articles/43595.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/flyonok/comments/commentRss/43595.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/flyonok/services/trackbacks/43595.html</trackback:ping><description><![CDATA[<p class="fancy">For obsolete instructions for Fedora Core 5 (FC5)
and Fedora Core 6 (FC6) version of this page look
<a  href="http://www.ccl.net/cca/software/SOURCES/JAVA/JSDK-1.5/" class="link" target="_blank">[ Here ]</a>.</p>
<p class="pagebody">The update for this page was inspired by email
from David Nedrow (dnedrow at mac com). He sent me a short synopsis
of how to do it with new Java 6 and Fedora 7, and I got new strengths
to go through these steps again on my laptop. Thanks David...</p>
<p class="fancy">If you want to upgrade JDK version but there is no
compat package for it yet on JPackage site, read
<span class="red">entire</span> document
<span class="red">without touching anything on your computer</span>
and then you will have known what to do.</p>
<p class="pagebody"><strong>What is the problem with F7 and JDK from Sun?</strong></p>
<p class="pagebody">
Fedora &amp; Linux distribution comes with the GNU Java.
This is a part of the popular GNU C compiler suite that also
includes support for other programming languages, like Fortran.
The GNU Java now supports most of the features of Sun Java 1.5
and in many cases can be augmented by additional open source
packages to be almost functionally equivalent to the latest JDK from Sun.
It has also some important advantages (e.g., option to produce
native machine code) but it is by necessity behind with the features
of the latest Java Development Kit from Sun. More information can
be found at the <strong>GNU Compiler for the Java</strong> page at:
<a  href="http://gcc.gnu.org/java/" class="link" target="_blank">http://gcc.gnu.org/java/</a>.
Recently Sun announced that it is legal to redistribute their
Java Development Kit, however, it is unlikely that it will be
a part of Fedora.
The reason for this is that Sun Java Development Kit is
not provided with the complete source code, while the Fedora Core Linux
only provides packages that are open source. This may change in the future,
but it is today</p>
<p class="pagebody">In most cases you will be fine with the
Open Source, GNU Java. Most open source projects that
need Java Development Kit do work with the GNU Java.
But some do not... Especially those that push latest standards
to the limits and require the latest features of the Java SDK
from Sun. With the race to new standards for Java, you may need
the Sun's Java SDK, but you also do not want to break
the code that assumes that GNU Java is available on your machine.
You will definitely need the Sun JDK if you use their <em>latest
and greatest</em> IDEs or Enterprise type solutions.
But <strong>YOU DO NOT WANT TO BRUTALLY DELETE/UNINSTALL the GNU Java</strong>
or just put the Sun JDK into <tt>/opt</tt> and change the
<tt>$JAVA_HOME</tt> and <tt>$CLASSPATH</tt>. Luckily there
is a nice solution via <tt>alternatives</tt> package that
comes with Fedora. We are even more lucky that there is
a <a  href="http://jpackage.org/" class="link" target="_blank">JPackage.org</a> project and that Fedora
supports it.</p>
<p class="pagebody"><strong>Make Sun JDK your default</strong></p>
<p class="pagebody"><strong>Note:</strong> There are many approaches to installing
Sun JDK under Linux. Some go through the route of building the RPM with paths
and directories suitable for Fedora. What I describe here is
a different approach in which the original Sun JDK RPM file
is used, but it is <em>brought into compliance</em> with Fedora via
creating symbolic links and the <tt>alternatives</tt> command
through the JPackage.org RPM package.</p>
<p class="pagebody">Start from becoming a <tt>root</tt> by logging in
as <tt>root</tt> or by <tt>sudo</tt> or simply by:</p>
<pre>   su -<br></pre>
<p class="pagebody">and get the latest JDK from Sun
<a  href="http://java.sun.com/downloads/" class="link" target="_blank">http://java.sun.com/downloads</a>.
Select the Java SE (Java Standard Edition), and then
Java SE (JDK) 6.
Choose the latest edition (at this writing it was JDK 6 Update 2,
and get the <strong>Linux RPM in self-extracting
file</strong> (DO NOT DOWNLOAD <em>Linux self-extracting file!</em>). You should
get a file like <tt>jdk-6u2-linux-i586-rpm.bin</tt>
that is about 65 MBytes in size. If it does not have
the <tt>rpm.bin</tt> at the end, you took the wrong one.<br>
I would also (and strongly advise if you have disk to spare) to
get the Java SE 6 Documentation (a <tt>jdk-6-doc.zip</tt> file) which
is about 52 MBytes. There is also a Japanese version of docs
but I do not speak this language. Once the documentation docs
arrive, you can unpack them under your web server document tree, e.g.,
is you are using standard Apache on F7 do:</p>
<p>
</p>
<pre>cd /var/www/html<br>mkdir JDK-1.6<br>cd JDK-1.6<br>unzip ...jdk-6-doc.zip<br></pre>
<p class="pagebody">and then view the docs under:
<tt>http://localhost/JDK-1.6/docs</tt>.
Of course, watch for Copyright. My advise is: make sure it cannot be
seen by people from outside your organization.
While you can view docs as <tt>file</tt>s under FireFox, they have examples
that may not render well without web server (applets and JavaScript
will not run on a <tt>file:</tt> URL for security reasons).<br>
</p>
<p class="pagebody">While you are downloading this large file,
please downloads the keys for the <strong>JPackage</strong> repository:</p>
<pre>   rpm --import http://jpackage.org/jpackage.asc<br></pre>
<p class="pagebody">and install the <strong>JPackage</strong> repository information
for the <tt>yum</tt>:</p>
<pre>   cd /etc/yum.repos.d<br>   wget http://www.jpackage.org/jpackage17.repo<br></pre>
<p class="pagebody">If it did not work, maybe you do not have <tt>wget</tt>.
You can check it with:</p>
<pre>  rpm -qi wget<br></pre>
<p class="pagebody">and if you do not have it, install it with:</p>
<pre>   yum install wget<br></pre>
<p class="pagebody">and try again to get the <tt>jpackage17.repo</tt> file.
The <tt>jpackage17.repo</tt> file comes with the <tt>jpackage-generic</tt>
repository enabled. However, I personally disabled the automatic
retrieval of updates and packages from the
<a  href="http://www.ccl.net/cca/software/SOURCES/JAVA/JSDK-1.6/jpackage.org" target="_blank" class="link">JPackage.org</a>
repository by editing the <tt><strong>/etc/yum.repos.d/jpackage17.repo</strong></tt>
file and changing line(s) <tt><strong>enabled=1</strong></tt> to the
<tt><strong>enabled=0</strong></tt> . I do not want to
risk the situation when, due to some dependency, the new Java packages
will be installed on my machine without my knowledge during
updates that are run automatically at night. Moreover,
Fedora 7 default Java packages are already in the
Fedora repositories (i.e., were officially <em>blessed</em>
by Fedora team), and it is probably better to
try these repositories first rather than to go directly to the JPackage.org and
risk messing up some naming convention and/or dependencies.
At the same time, JPackage repository can be always enabled
in <tt>yum</tt> by adding the:<br>
<tt>--enablerepo=jpackage-generic
--enablerepo=jpackage-generic-nonfree</tt><br>
options on the command line.<br>
Note... There are Fedora repositories on
JPackage.org but there are no files in them from what I see.
The <tt>jpackage17.repo</tt> file that you downloaded in the part</p>
<pre>[jpackage-generic-nonfree]<br>name=JPackage (non-free), generic<br>mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_1.7.txt<br>failovermethod=priority<br>gpgcheck=1<br>gpgkey=http://www.jpackage.org/jpackage.asc<br>enabled=0<br></pre>
<p class="pagebody">is just wrong (at least on Sept 3, 2007 when I was trying).
The problem is that the file:
<a  href="http://www.jpackage.org/jpackage_generic_nonfree_1.7.txt" class="link" target="_blank">http://www.jpackage.org/jpackage_generic_nonfree_1.7.txt</a>
just does not exist. So rather than use a mirror list, I placed there
specific URLs to the repositories. Therefore, edit the <tt>jpackage17.repo</tt>
to read:</p>
<pre>[jpackage-generic-nonfree]<br>name=JPackage (non-free), generic<br>baseurl=<br>        ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/non-free/<br>        ftp://ftp.mirrorservice.org/sites/jpackage.org/1.7/generic/non-free/<br>        http://sunsite.rediris.es/mirror/jpackage/1.7/generic/non-free/<br>        ftp://ftp.pbone.net/pub/jpackage/1.7/generic<br>failovermethod=priority<br># Check list on: http://www.jpackage.org/mirroring.php#mirrors<br># mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree_1.7.txt<br>gpgcheck=1<br>gpgkey=http://www.jpackage.org/jpackage.asc<br>enabled=0<br></pre>
<p class="pagebody">Of course, the other repositories in
<tt>jpackage17.repo</tt> file also
may need changing, but I did not go that far, since I am now only
installing JDK and I will worry later as also will you.<br>
Since you will be dealing with RPMs, make also sure that you have packages
to manipulate them:</p>
<pre>   rpm -qi rpm-build<br>   rpm -qi fedora-rpmdevtools<br></pre>
<p class="pagebody">If you do not have them, install them:</p>
<pre>   yum install fedora-rpmdevtools<br>   yum install rpm-build<br></pre>
<p class="pagebody">Check if you have packages
for GNU Java compiler/libraries installed, since you most likely
need to have some <em>symmetry</em>
between GNU and Sun JDKs so the <tt>alternatives</tt>
is not confused. But, frankly, I do not know the intrinsics of it,
though it cannot hurt and disk space is cheap.</p>
<pre>   yum list available '*gcj*'<br></pre>
<p class="pagebody">will list the available but not installed yet
pieces of <tt>gcj</tt> (GNU Java compiler) and you can install
these packages as:</p>
<pre>   yum install <em>package1</em> <em>package2</em>...<br></pre>
<p class="pagebody">or just:</p>
<pre>   yum install '*gcj*'<br></pre>
<p class="pagebody">Please read the <tt>man</tt> page for
<tt>alternatives</tt>:</p>
<pre>   man alternatives<br></pre>
<p class="pagebody">When your Sun JDK <strong>Linux RPM self-extracting file</strong>
finally arrives you need to execute it, since it is a shell script.
It contains the license agreement and the compressed RPM package with
Sun JDK. It will ask you if you agree to the long license. Say <tt>yes</tt>,
then it will uncompress the RPM with JDK, and then it will install it
together with bunch of other modules. To run it do:</p>
<pre>   chmod 755 jdk-6u2-linux-i586-rpm.bin<br>   ./jdk-6u2-linux-i586-rpm.bin<br></pre>
<p class="pagebody">Unfortunately, the Sun RPM package puts files
in different locations than the ones required by Fedora 7.
After running the script you will see a new directory
<tt>/usr/java/jdk1.6.0_02</tt> with JDK files and directories and
the new directory <tt>/opt/sun</tt>. In the directory where you ran
the <tt>jdk-6u2-linux-i586-rpm.bin</tt> a bunch of <tt>*.rpm</tt> were
created:</p>
<pre>jdk-6u2-linux-i586.rpm<br>sun-javadb-client-10.2.2-0.1.i386.rpm<br>sun-javadb-common-10.2.2-0.1.i386.rpm<br>sun-javadb-core-10.2.2-0.1.i386.rpm<br>sun-javadb-demo-10.2.2-0.1.i386.rpm<br>sun-javadb-docs-10.2.2-0.1.i386.rpm<br>sun-javadb-javadoc-10.2.2-0.1.i386.rpm<br></pre>
<p class="pagebody">You can look what files that are inside the RPMs by
running <tt>rpm</tt></p>
<pre>rpm -q -l -p jdk-6u2-linux-i586.rpm<br>rpm -q -l -p sun-javadb-client-10.2.2-0.1.i386.rpm<br>rpm -q -l -p sun-javadb-common-10.2.2-0.1.i386.rpm<br>...<br></pre>
<p class="pagebody">You can also use your browser (say FireFox) to look
at the docs, but linking the doc location to a directory under
web document tree. For example as:</p>
<pre>cd /var/www/html/JDK-1.6    # or create it, if not created as described above<br>ln -s /opt/sun/javadb javadb<br></pre>
<p class="pagebody">and you will be able to point your browser
to <tt>http://localhost/JDK-1.6/javadb</tt> and learn all the exciting
details about Apache Derby for doing DB under Apache. Nice stuff, but
not here... The actual RPMs are left in the directory where you ran the Sun's
<tt>jdk-6u2-linux-i586.rpm.bin</tt> script, however,
you do not need to process the RPMs, since the script already did it.
You may, however, use  the RPM packages later, if you want to install
the JDK on another machine.
Now, you are ready to install the SUN JDK compatibility RPM
from the JPackage.org</p>
<pre> yum --enablerepo=jpackage-generic-nonfree install java-1.6.0-sun-compat-1.6.0.02-1jpp<br></pre>
<p class="pagebody">It should ask you for your <strong>Yes</strong> and announce:
<nobr><tt>Installed: java-1.6.0-sun-compat.i586 0:1.6.0.02-1jpp</tt></nobr>.
</p>
<p class="pagebody">This will create a bunch of links in the
<tt>/etc/alternatives</tt>, <tt>/usr/share/man/man1</tt>,
<tt>/usr/lib/jvm</tt> and others to the <tt>/usr/lib/jvm/java-1.6.0-sun</tt>
link that points to the link that points to ... files in
<tt>/usr/java/jdk1.6.0_02</tt> where the Sun JDK distribution resides.
To check which files were affected do:</p>
<pre>   rpm -q -l java-1.6.0-sun-compat<br></pre>
<p class="pagebody">Check if the Sun JDK is really a default by doing:</p>
<pre>  java -version<br></pre>
<p class="pagebody">If you get:</p>
<pre><em><br>java version "1.5.0"<br>gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)<br><br>Copyright (C) 2006 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions.  There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br></em></pre>
<p class="pagebody">(or similar) <span class="red">then something
did not work</span>.
If you get:</p>
<pre><em><br>java version "1.6.0_02"<br>Java(TM) SE Runtime Environment (build 1.6.0_02-b05)<br>Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)<br></em></pre>
<p class="pagebody"><span class="green">then the Sun JDK is your
default</span>. You can use
<tt>alternatives</tt> to check (or change) the default JDK by:</p>
<pre>  alternatives --config java<br></pre>
<p class="pagebody">It should show something like:</p>
<pre><em><br>There are 2 programs which provide 'java'.<br><br>  Selection    Command<br>-----------------------------------------------<br>   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java<br>*+ 2           /usr/lib/jvm/jre-1.5.0-sun/bin/java<br><br>Enter to keep the current selection[+], or type selection number:<br></em></pre>
<p class="pagebody">Hit <tt>[Enter]</tt> key if you want Sun JDK to
be a default, or enter <tt>1</tt> if you want to change back to GNU Java.
The JPackage compatibility should also make you a link for Java plug-in
for Firefox browser. To make sure it did, do:</p>
<pre>  cd /usr/lib/mozilla/plugins<br>  ls -l<br></pre>
<p class="pagebody">If you get:</p>
<pre><em><br>lrwxrwxrwx 1 root root    77 Jun 17 20:47 libjavaplugin_oji.so -&gt; <br>  /usr/lib/jvm/java-1.6.0-sun-1.6.0.02/jre/plugin/i386/ns7/libjavaplugin_oji.so<br></em></pre>
<p class="pagebody">you should be fine. If you do not have it, make
this link yourself (but then worry, since something is not right):</p>
<pre>  cd /usr/lib/mozilla/plugins<br>  ln -s /usr/lib/jvm/java-1.6.0-sun-1.6.0.02/jre/plugin/i386/ns7/libjavaplugin_oji.so \<br>    libjavaplugin_oji.so<br></pre>
<p class="pagebody">The Firefox should look for plug-ins in the
<tt>/usr/lib/mozilla/plugins</tt> directory.
If your Firefox still does not work with Java,
put the link above also in the directory
<tt>/usr/lib/firefox-2.0.0.5/plugins</tt>,
or whatever is your particular version of Firefox that you can dig out from
the script that runs it: <tt>/usr/bin/firefox</tt> or whatever is reported
by:</p>
<pre>  which firefox<br></pre>
<p class="pagebody">There are different distros of Firefox, so you
may be <em>special</em> but for your own sake, use <tt>yum</tt> to
update Firefox.<br>
</p>
<p class="pagebody"><strong>Updating your Sun JDK</strong></p>
<p class="fancysmall">If there is no compat rpm for the new JDK on the
JPackage site, do not despair, and read further.</p>
<p class="pagebody">Now, there will be times, when you want to get rid
of Sun JDK and its entries for <tt>alternatives</tt>.
<strong class="red">DO NOT TOUCH THESE
LINKS WITH YOUR BARE HANDS</strong>. Use <tt>yum</tt> to uninstall the
JPackage Java compatibility package first and then erase
the Sun JDK with <tt>rpm</tt>:</p>
<pre>yum erase java-1.6.0-sun-compat<br>rpm -e jdk-1.6.0_02-fcs<br></pre>
<p class="pagebody">Be bold... Do not worry...
You can always reinstall it as described above. Of course, you
can choose to use <tt>rpm</tt> command directly rather than
<tt>yum</tt> to work with packages. But <tt>yum</tt> has a lot
of advantages, since it will maintain the packages and upgrades
and makes a lot of checks to see if things will not break.
But sometimes they break. A popular situation is when you
used <tt>rpm</tt> to install some package (or the package
was installed with an <em>install</em> (older package is
kept) rather than an <em>update</em> (older package is
removed). In this case, <tt>yum</tt> gets confused with
dependencies and complains, and it does not want to install
a package. To see if this is a case, list all the installed
rpm packages for some package name with a command:</p>
<pre>   rpm -qa | grep "^java" | sort<br></pre>
<p class="pagebodys"><em>(Helpful suggestion from Bob Gustafson, Thanks!)</em></p>
<p class="pagebody">for example. If you see two versions
of the same rpm, just erase the <strong>older</strong> (i.e., with
the lower revision number) one. Use the</p>
<pre>   rpm -e full_package_name_with_version<br></pre>
<p class="pagebody">(but skip the <tt>.rpm</tt>) and then
try <nobr><tt>yum update</tt></nobr>
or <nobr><tt>yum install</tt></nobr> again. I am telling you this,
since we will definitely have more <em>javas</em> and <em>compats</em>
coming, and the <tt>mess happens</tt>. For example (at this time
a hypothetical one), if you got stuck with two <em>compat</em>
packages when updates to the JDK were processed:</p>
<pre>   rpm -qa | grep "java-1.6.0-sun-compat"<em><br>   java-1.6.0-sun-compat-1.6.0.02-1jpp<br>   java-1.6.0-sun-compat-1.6.0.03-1jpp<br></em></pre>
<p class="pagebody">remove the older package as:</p>
<pre>   yum erase java-1.6.0-sun-compat-1.6.0.02-1jpp<br></pre>
<p class="pagebody">or, if still <em>no go</em>:</p>
<pre>   rpm -e java-1.6.0-sun-compat-1.6.0.02-1jpp<br></pre>
<p class="pagebody">or</p>
<pre>rpm -e --nopostun java-1.5.0-sun-1.5.0.09-1jpp<br></pre>
<p class="pagebody"> [ in general, if you see the error: <nobr><tt>%postun(...) scriplet failed</tt></nobr> you should try:
<nobr><tt>rpm -e --nopostun the_package_name </tt></nobr> to delete
the stubborn package ].</p>
<p class="pagebodys"><em>(Suggestions above from Bob Gustafson, Thanks!)</em></p>
<p class="pagebody">and check again if something is still left with:</p>
<pre>   rpm -qa | grep "^java" | sort<br></pre>
<p class="pagebody">If you are still stuck, try deleting the
Sun JDK first, e.g.:</p>
<pre>rpm -e jdk-1.6.0_02-fcs<br></pre>
<p class="pagebody">and then try to delete the compat RPMs again.
This problem showed up in FC6 while upgrading JDK
and I still do not know if this
is an ugly <strong><em>bug</em></strong> or an interesting <strong><em>feature</em></strong>.</p>
<p class="pagebody"><strong>Updating your Sun JDK when the compat
rpm package is not yet available from JPackage site</strong></p>
<p class="pagebody">I upgraded from <tt>jdk-1.6.0_02-fcs</tt> to
<tt>jdk-1.6.0_03-fcs</tt> on Oct 5, 2007, and there was no
<tt>java-1.6.0-sun-compat-1.6.0.03-1jpp</tt> at that time.
Of course, the stuff changes and can change enough that this simple
patch to older compat rpm will not work. So... This is <em>experimental</em>
at best.</p>
<p class="pagebody">First you need to erase your old compat rpm and
Java SDK as described above. In this case the following did it:</p>
<pre>yum erase java-1.6.0-sun-compat-1.6.0.02-1jpp<br>yum erase jdk-1.6.0_02-fcs<br></pre>
<p class="pagebody">Then you need to get a new JDK from Sun. In
this case:</p>
<ul class="pagebody">
    <li>Retrieved the new JDK from Sun
    <a  href="http://java.sun.com/javase/downloads/" class="link" target="_blank">http://java.sun.com/javase/downloads/</a> </li>
    <li>Take: JDK 6 Update 3, Linux RPM in self-extracting file</li>
    <li>Click on <em>Accept License Agreement</em></li>
    <li>Click on <tt>jdk-6u3-linux-i586-rpm.bin</tt> link and have
    a coffee when it downloads.</li>
</ul>
<p class="pagebody">Then install the new JDK</p>
<pre>chmod 755 jdk-6u3-linux-i586-rpm.bin<br>./jdk-6u2-linux-i586-rpm.bin<br></pre>
<p class="pagebody">Then you have to downloads the old compat
package but not the one you used to install the JDK but its <strong>source</strong>
version. If you <em>browse the JPackage site with the browser</em>,
<a  href="http://www.jpackage.org/browser/browse.php?jppversion=1.7" class="link" target="_blank">http://www.jpackage.org/browser/browse.php?jppversion=1.7</a>,
they will be under <em>non-free</em> <tt>java-1.6.0-sun-compat</tt> at the
end, then under the <strong>[S]</strong> link. In my case it was at:
<a  href="http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/SRPMS/java-1.6.0-sun-compat-1.6.0.02-1jpp.src.rpm" target="_blank" class="link">http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/SRPMS/java-1.6.0-sun-compat-1.6.0.02-1jpp.src.rpm</a> .
I also edited (or created, if you do not have it), the file:
<tt>/root/.rpmmacros</tt> and placed there a line:</p>
<pre>%_topdir   /usr/src/redhat/<br></pre>
<p class="pagebody">Then (as a <tt>root</tt> of course) I did</p>
<pre>rpm -ihv java-1.6.0-sun-compat-1.6.0.02-1jpp.src.rpm<br></pre>
<p class="pagebody">and the thing installed the following files:</p>
<pre>/usr/src/redhat/SOURCES/java-1.6.0-sun-compat-register-java-fonts.xsl<br>/usr/src/redhat/SOURCES/java-1.6.0-sun-compat-unregister-java-fonts.xsl<br>/usr/src/redhat/SPECS/java-1.6.0-sun-compat.spec<br></pre>
<p class="pagebody">You will need to edit the <tt>SPEC</tt> file
(<tt>java-1.6.0-sun-compat.spec</tt>)
before you can build the updated <tt>rpm</tt> package for the new
JDK. In this case it is VERY EASY (I believe...). I changed the line:</p>
<pre>%define buildver        02<br></pre>
<p class="pagebody">to a line:</p>
<pre>%define buildver        03<br></pre>
<p class="pagebody">Then I ran the <tt>rpmbuild</tt> (which you have
installed long time ago, didn't you? I talked about it at the top of this
document).</p>
<pre>cd /usr/src/redhat/SPECS<br>rpmbuild -ba java-1.6.0-sun-compat.spec<br></pre>
<p class="pagebody">This created a new, updated, compat <tt>rpm</tt>
package in the directory <tt>/usr/src/redhat/RPMS/i586</tt>. So now
what you need to do is:</p>
<pre>cd /usr/src/redhat/RPMS/i586<br>rpm -ihv java-1.6.0-sun-compat-1.6.0.03-1jpp.i586.rpm<br></pre>
<p class="pagebody">and you should be in this place in this document
where you installed the compat package using <tt>yum</tt> and the
<tt>JPackage</tt> repository</p>
<p class="pagebody"><strong>So... Where the heck is my <tt>JAVA_HOME</tt>?</strong></p>
<p class="pagebody">Relax... </p>
<pre>   JAVA_HOME=/usr/lib/jvm/java<br>   export JAVA_HOME</pre>
<p class="pagebody">or if you are C-shellish:</p>
<pre>   setenv JAVA_HOME /usr/lib/jvm/java</pre>
<p><span class="fancy">Jan K. Labanowski</span><br>
<span class="fancysmall">Computational Chemistry List, Ltd.</span><br>
<a  href="http://www.ccl.net/" target="_blank" class="link">http://www.ccl.net</a><br>
</p>
<p class="pagebody">If you think that I erred, please let me know
and I will be thankful and will correct... I promise... One more thing
(a disclaimer...): If you believed in anything what I said, and you lost time
and money, it is your fault... I am telling you again... I may have made
a mistake, and I do not guarantee that anything will work as described...</p>
<tt>jkl at ccl . net</tt><img src ="http://www.cppblog.com/flyonok/aggbug/43595.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/flyonok/" target="_blank">flyonok</a> 2008-03-03 12:36 <a href="http://www.cppblog.com/flyonok/articles/43595.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>