|
Sun Java 5 or 6 Install Feisty |
|
|
|
|
Sunday, 04 March 2007 |
|
After a day of Kubuntu Feisty Herd test release five I am very impressed, easiest Java Install to date! This will get Java installed and working for Java applications as well as browser support. Firefox and Konqueror worked perfectly, but I have not tried other browsers. This will work for Java6 also just change the version numbers, i.e. java-6-sun.
Open Adept under System in the Start Menu. Go into "Manage Reposotories" under File menu and check that all repos are checked. Mine were by default. Close...
Search Sun in Adept package search.
Tick the following for install:
Sun-Java5-bin Sun-Java5-fonts Sun-Java5-jre Sun-Java5-fonts Sun-Java5-jdk You will need to accept the license so click the "Show Details" button when installation starts. Accept the license by scrolling down the license text and ticking the accept box, click next to finish.
Now we need to select the default Java for the system to use and set some variables and paths.
Open a terminal (command prompt) and issue the following command:
$ sudo update-alternatives --config java
You should see output like so:
There are 2 alternatives which provide `java'.
Selection Alternative ----------------------------------------------- 1 /usr/bin/gij-wrapper-4.1 *+ 2 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
Press enter to keep the default[*], or type selection number:
Since we have * beside option two nothing needs to be done. If Sun Java isn't set as default select it now.
Now we need to check some things. Open your Home directory in Konqueror and select "Show hidden files" under the view menu.
Open .bash_profile with your favorite text editor.
You need to add java to your path and set JAVA_HOME and CLASSPATH. Make a backup of your .bash_profile just in case.
Here is an example on a clean Kubuntu Feisty test 5 install (notice the PATH change compared to your default bash_profile):
# set PATH so it includes user's private bin if it exists if [ -d ~/bin ] ; then PATH=/usr/lib/jvm/java-1.5.0-sun/bin:~/bin:"${PATH}" fi
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun export CLASSPATH=/usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/usr/lib/jvm/java-1.5.0-sun/jre/lib/rt.jar:./
To get our changes set do Ctrl+Alt+Backspace to restart KDE. |