Installing Java on Fedora
The source of this post are some threads found on Fedora Forum. The Java distribution used was the found at theSun site, i downloaded this jdk-1_5_0_06-linux-i586-rpm.bin. Open a terminal, look for the file and give it execution permisions:
# chmod a+x jdk-1_5_0_06-linux-i586-rpm.bin
# ./jdk-1_5_0_06-linux-i586-rpm.bin
By default Fecore has installed a different version of Java, so it is necesary to tell it that uses the new one. There is a link in /usr/bin/java that actually starts Java, so it needs to be pointed to the correct Java installation. The easiest way to do this (to presserve both or all installations of Java) is to use alternatives. If you issue the command alternatives --config java you will see a single entry pointing to something like /usr/lib/jvm/jre-1.4.2-gcj/bin/java, this is the binary executed when you issue java from the terminal.
All you need to do is add the link (path) to the new installation of Java, from SUN, try the following:
# alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_06/bin/java 2
Its usage is alternatives link name path priority. Once you add the new Java configuration to alternatives all you need to do is activate, to tell the system this is what should be run as /usr/bin/java:
# alternatives --config java
this will give you a menu of Java installations. choose the second option (hence, priority 2) and hit enter. now when you type something like java -jar filename.jar it will use the SUN Java instead of the included gcj. Note: you can also delete the /usr/bin/java and make a new symbolic link to the java binary of the new java installation, but i do not recommend this.
Also, some Java based applications requiere that exists a environment variable pointing to the directory where is Java installed, it is the famous JAVA_HOME. In order to get this, create the file /etc/profile.d/java.sh with the following content:JAVA_HOME=/usr/java/jdk1.5.0_06
JDK_HOME=$JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:/usr/java/jdk1.5.0_06/jre/lib/rt.jar
export CLASSPATH PATH JDK_HOME JAVA_HOMEYou can check the variable content issuing echo $JAVA_HOME.
Source
Installing JDK6 on Debian Etch or UbuntuLabels: linux

0 Comments:
Post a Comment
<< Home