The moose likes Linux / UNIX and the fly likes Environment variable in linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Environment variable in linux" Watch "Environment variable in linux" New topic

Environment variable in linux

Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

The environment variable where i store the xml files physical path then in the class i read the environment variable and pass it to the
Here is the code for the above.
String path=System.getenv("CONFIG_PATH").toString();//read the environment variable named CONFIG_PATH
filePath=new File(path).toURI().toString();
and pass it on to the ConfigHandler
ConfigHandler config=new ConfigHandler(filePath);
I have created the environment variable in windows where i store the physical path of the Config.xml file, I am able to read the path of the environment variable in windows but not in linux redhat 5 server
The prob is that i need to deploy it on the linux redhat 5 server.
on linux also i have declared the environment variable with the same name but it does not reads the file when i deploy the project as a war in tomcat 5.5 but when i tried to test it with a sample jsp it read the environment variable. can any one give any hint. i have given 777 rights for that war file so root can execute the war file.
any suggestions??

[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

This post has been moved to a more appropriate forum.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Environment variable in linux
It's not a secret anymore!