Here. This is a Java install HOWTO I wrote some time ago and I keep
around in case anyone needs it.
Don't be intimidated by the length of this. It's long because I've done
something I believe in, which is explain why as well as show how. Ask
for clarification if you need any. ;-)
1. Go to java.sun.com and download either the java2 SDK (Software
Development Kit) or the java2 JRE (Java Runtime Environment) Note that
the JRE is a subset of the SDK (Software Develpment Kit) and just
contains what you need to run stuff not develop Java programs. You can
probably also order it on disk from Sun if you have a bandwidth problem
(i.e. you are stuck on dialup and don't know anyone with a faster
connection).
2. Most of the rest of the stuff needs to be done as superuser. You'll
need the root password and the following command executed from a
terminal window or the console:
su
Note: This one of the best and most secure ways to use administrative
privileges on a Unix/Linux box. There is always the possibility, however
remote, that usage of administrative privileges on *any* computer system
running *any* OS, can be a security risk. It is wise to close superuser
logins you are not using. Use the exit command to get back to a regular
user window. Most folks will also tell you to never log in as root
unless it is unavoidable. On occasions when it *is* unavoidable, it is
wise to unplug your system from the network first, as a security precaution.
3. The file that you will receive ends in ".bin" This means that it is
a binary that can be run from the command line like so:
./somecommand[enter]
You will find that executeing the file and answering the questions the
program asks in this manner causes a nice little rpm like we are used to
working with to be extracted from the binary into the same directory.
Neat trick, huh? ;-)
4. STOP. If you are using a system that has kaffe on it, we cannot at
this point install the RPM because kaffe is still in the way. The trick
here is to eliminate kaffe without eliminating the programs that depend
on kaffe from the rpm database. We do this
like so:
First:
rpm -qa | grep kaffe
The above command should give you the exact name of the kaffe package
that you want to uninstall. If it does not return anything it means you
don't have kaffe installed and move on to 5.
Next:
rpm -e --nodeps [paste kaffe's package name info here]
Note: Use the "--nodeps" switch with caution. It is extremly powerful
and therefore potentially dangerous. Make sure you have a pretty good
idea what you are doing before you use it.
5. OK, NOW we can install the new java rpm. We do this by the following
command:
rpm -U rpmfilename.rpm
6. We have one more thing left to do and this is actually where most
folks get stuck. The rpm above will install your java stuff into the
/usr/java/[name-of-java-directory]/ directory with the actual binaries
stored in the /usr/java/[name-of-java-directory]/bin directory. This
directory is probably not in the path that your computer searches for
commands and as a consequence when the computer tries to use the
software it will not be able to find it. We have 2 options for fixing this:
A. We can fix the path.
B. We can put up some sign posts that the computer will be able to
follow. These are called "symbolic links" or "symlinks".
The symlink method is probably the easiest as well as the safest.
Mainly because if they don't work it doesn't hurt anything and there are
no script files to screw up.
Basically you take all of the files in the
/usr/java/[name-of-java-directory]/bin directory and create links in the
/bin directory that point to them.
Use this command to create the links:
ln -s /usr/java/[name-of-java-directory]/bin/* /bin/
Now we want to test to see if it works.
Change back to a regular user by using the "exit" command and type;
cd
java -version
Note: cd will just put you back in your home directory.
You should be good to go if you get something that looks like:
[jcolling@enigma jcolling]$ java -version
java version "1.4.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_02-b02)
Java HotSpot(TM) Client VM (build 1.4.0_02-b02, mixed mode)
[jcolling@enigma jcolling]$
OK. Enjoy. Time for Jim's coffee break! ;-)
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com