File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Set up DOMAIN_HOME environment variable in SUSE Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Set up DOMAIN_HOME environment variable in SUSE Linux" Watch "Set up DOMAIN_HOME environment variable in SUSE Linux" New topic
Author

Set up DOMAIN_HOME environment variable in SUSE Linux

kazeopeia joshi
Greenhorn

Joined: Jul 07, 2011
Posts: 12
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

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.
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
set variables in /etc/profile.local

DOMAIN_HOME=/yourpath
export DOMAIN_HOME

Sandeep
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

I'm not sure what this "DOMAIN_HOME" is, since usually I think of a domain as being something like "mousetech.com", not a filesystem path.

But it doesn't really matter.

You can set up environment variables in a number of places. Whenever a new shell is created, it will (usually) query some or all of those places. I'd be more specific, except that the exact list varies depending on the distro and on which shell you're using. Plus, you can set profile options system-wide (for example, in the /etc/profile.d directory) or per-user (/home/tim/.bash_profile).


Customer surveys are for companies who didn't pay proper attention to begin with.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

It sounds like you may have done almost the right thing already; if you included that line as shown above in your .profile file, or other similar files -- except that the # character turns the whole thing into a comment. If you actually included the #, try again without it!


[Jess in Action][AskingGoodQuestions]
kazeopeia joshi
Greenhorn

Joined: Jul 07, 2011
Posts: 12
It just worked! Thank you so much!..
/home/Name/.profile worked for me...
 
 
subject: Set up DOMAIN_HOME environment variable in SUSE Linux