|
-
September 12th, 2011, 09:35 PM
#1
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.
-
September 13th, 2011, 04:23 AM
#2
Re: Set up DOMAIN_HOME environment variable in SUSE Linux
This is not really a java problem ... but here goes anyway.
1. If the line starts with a # it is a comment so will never be executed by the shell.
2. The export command must be in lower case (your example starts with a capital E).
3. You appear to be appending a value to (what is presumed to be) a previously set value. Whilst this is valid with colon separated lists (e.g. $PATH) I suspect this is not what you should be doing here.
4. No spaces between the variable and the equals and the value ... i.e:
Code:
export DOMAIN_HOME=/path_to_domain
B.T.W. Hope you are using a real path not the literal text /path_to_domain - that will proibably get you nowhere fast.
I'd also suggest that you don't make too many changes to /etc/bashrc - you could break the system for all users - stick to making changes in your .bashrc - which also means you don't need to be root and run less risk of messing things up.
You could try adding the following lines to . bashrc:
Code:
export DOMAIN_HOME=/path_to_domain
echo "Domain home set to $DOMAIN_HOME"
You should then see "Domain home set to /xxx/yyy/zzz" displayed when you start a shell.
-
September 14th, 2011, 06:02 AM
#3
Re: Set up DOMAIN_HOME environment variable in SUSE Linux
Yes, got it! It worked.. Thanks much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|