This content has been marked as final. Show 7 replies
Do you mean you need to setup your JAVA_HOME or add Java to your PATH?
PS: Google "setting JAVA_HOME on Linux" and/or "add Java to PATH Linux" should help you out :-)
To add the bin directory of the jdk to your own PATH, for your own work, try the following inside a bash shell:
1) Change into your home directory - cd $HOME
2) Open the file ".bashrc". I recommend vi for simplicity here - vi .bashrc
3) Add the following line to the file. Replace the term <jdk directory> with the name of your java installation directory - export PATH=/usr/java/<jdk directory>/bin:$PATH
4) then save and exit vi - :wq
5) Use the "source" command to force linux to reload the .bashrc file which normally is read only when you log in each time - source .bashrc
6) You can test your PATH setting by checking for the version - java -version
Note that if you wish to set the PATH setting for all users of the system, you will want to log in as root in the bash shell and perform the same steps upon the file "/etc/profile" rather than ".bashrc" in the home directory. Careful when editing system files. It's a good idea to make a backup of the file first just in case.
I did a search on the internet and found this article...
i tried as u said it didnt work i dont know were i made the mistake can u explain me more. please
Maybe you are not in bash.
If you did whatever is written there. type bash to enter the bash shell and then try java or javac.
I have the same question, I am also new to Linux Mandriva 2006
Somehow I installed java here ->
at /usr directory, I have ->
bash: java: command not found
jre1.5.0_09 is installed, though.
# here is my bash, is this correct?
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
How can I set the java path?
It needs to be set to get jajuk to work.
Hi dude... to set your new java path all you have to do is execute the following line:
export JAVA_HOME=/home/jose/Download/jre 1.5.0_09
#after the "=" you have to put your new path.... ;)
On some Linux systems they seem to donate a free JAVA_HOME setting to your env variables, so you may need to set both PATH and the JAVA_HOME variable.
And the bin directory should be early in the PATH, before /usr/bin.
Run 'env' and look for references to JAVA_HOME.
I'm not sure which Linux systems would just let you set JAVA_HOME only, but if that worked, that would be your best answer, unless you need to login to many different Linux systems like me.