In shell...
$ vi ~/.bashrc
Press 'a' on the keyboard to insert... and type in the following:
Code:
# User specific aliases and functions
PATH=$PATH:/usr/java/j2sdk1.4.2_06/bin
export PATH
**NOTE: Your path my differ, depending on version and if you have SDK or just JRE. Please go to the /usr/java directory and right down the proper directory name and be sure to add /bin on the end**
Press 'Esc' to stop inserting.
Press ':' to bring up the vi command prompt.
Press 'x' to exit and save.
Now log out of KDE or Gnome and log back in.
In shell...
$ which java
Should return the path to your java install.