Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I am running Java NetBeans 6.9 jdk 6 on SUSE Linux (a newbie on linux) and I currently need to get the path of the weblogic domain of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    7

    Question Set up DOMAIN_HOME environment variable in SUSE Linux


    Hi all,

    I am running Java NetBeans 6.9 jdk 6 on SUSE Linux (a newbie on linux) and I currently need to get the path of the weblogic domain of my Java application.
    I have read that I can directly access the environment variable by using this :

    System.getenv("DOMAIN_HOME")

    The problem is I couldn't find the DOMAIN_HOME environment variable (actually I have no idea on setting up the env. variable in linux). I found instructions on the internet telling me that I could set this up by setting :

    Export DOMAIN_HOME = /desired_path_to_domain

    Following several instructions found on the internet, I have already tried the following resolutions :

    1. I wrote this on my home's .profile
    #export DOMAIN_HOME=$DOMAIN_HOME:/path_to_domain
    2. I also wrote that on my home's .bashrc and on /etc/bash.bashrc
    3. I executed this on the konsole
    printenv
    ... and as expected I saw the list of all the environment variables. At first, I thought it was pointed to .profile but it wasn't. It was displaying an entirely different value from what was defined on .profile when I executed the line
    echo #PATH
    ... so I concluded that my environment variables weren't defined on .profile

    The question is, where exactly is that printenv (environment variables) defined and how can I modify it to include my DOMAIN_HOME variable. Guys, I really need this. I came up posting on forums because none of the solutions above or anywhere else could solve my problem. DOMAIN_HOME remains null (even after restarting my linux server)

    Thank you very much for any quick and kind response.
    Please help. Thanks.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Did you source the profile script (~/.bashrc, ~/.profile, etc.) after modifying them? Or log out and log back in?

    To do what you explain you need, I would do something like this: Edit my .bashrc file, e.g.:

    Code:
    vi ~/.bashrc
    And at the bottom of it I would put:
    Code:
    export DOMAIN_HOME=/path/to/domain
    IMPORTANT: note the lack of spaces before and after the equal sign, and the case sensitivity

    Then source the file:
    Code:
    . ~/.bashrc
    Then echo the new env var:
    Code:
    # echo $DOMAIN_HOME
    /path/to/domain

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    7
    It just worked! Thank you so much!..
    /home/Name/.profile worked for me...

Posting Permissions

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