Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, I need to set path for java and some files permanently.. Below is my requirement, export JAVA_HOME=/root/EC2/jre1.5.0_16/ export EC2_HOME=/root/EC2/ec2-api-tools export PATH=$PATH:$EC2_HOME/bin export C2_PRIVATE=/root/EC2/aws-private export C2_CERT=/root/EC2/aws-cert Please help me ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! geethas's Avatar
    Join Date
    May 2008
    Posts
    33

    setting environmental variables permanently


    Hi all,

    I need to set path for java and some files permanently..

    Below is my requirement,

    export JAVA_HOME=/root/EC2/jre1.5.0_16/
    export EC2_HOME=/root/EC2/ec2-api-tools
    export PATH=$PATH:$EC2_HOME/bin
    export C2_PRIVATE=/root/EC2/aws-private
    export C2_CERT=/root/EC2/aws-cert

    Please help me how to do this..

    Thanks in advance
    Sg..

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    You can do this in a users ~/bash_profile or globally in /etc/profile. Some distros have a directory called /etc/profile.d where you create scripts that contain the environmental variables you want to set. This means that you don't have to touch /etc/profile.

  3. #3
    Just Joined! geethas's Avatar
    Join Date
    May 2008
    Posts
    33
    thanks daark..

    I have to set system wide, I used /etc/profile, but not working..

    after that we need to run any services?

    regards,
    sg..

  4. #4
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Did you log out and back in again or run "source /etc/profile" after setting the variables?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •