Announcement

Collapse
No announcement yet.

setting environment variables?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    setting environment variables?

    Hey guys, i wanted to ask if anyone knows how to make the java executable files (javac/java) system wide available. I have jdk 1.5 installed in /usr/local/jdk1.5.0 and i also created a symlink in the same directory as /usr/local/jdk . I've tried adding these two lines in etc/profile: export PATH=$PATH:/usr/local/jdk/bin and export JAVA_HOME=/usr/local/jdk thinking it would make the executables available anywhere, but it didn't. I logout and login again but still get "command not found" error when i type javac.

    Can anyone help out here please? It's not so much a java problem but simply knowing how to make this process work i think.

    Thanks.


    #2
    Re: setting environment variables?

    /etc/profile is for login shells, /etc/bash/bashrc is for non-login shells.
    If you run konsole -ls the paths will show, but you are better off duplicating the export PATH= lines in bashrc

    Comment


      #3
      Re: setting environment variables?

      Thanks Teppic. I got it running after all. There seemed to be a problem with the symlinks i created. I basically added /usr/local/jdk1.5.0 to my path instead of the link /usr/local/jdk and now i can run the commands javac + java no problem.

      just for the record...the installation of Sun's Java does add those executables in /etc but if for some reason someone installs gcj as well then they are symlinked to GNU's compiler and VM. So those have to be removed from /etc in order to run proprietary java.

      Thanks for your help. I still don't quite understand why the symlinks wouldn't work, but that's a different issue i suppose. Thanks again. I will add the variables to bashrc as well.

      Comment

      Working...
      X