Meaningless Drivel is fun!*
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
Author

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 connections.java class i read the environment variable and pass it to the confighandler.java
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.!!!
SCJP1.5.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Environment variable in linux
 
Similar Threads
Java versioning problem
Reading a file which is specified in CLASSPATH
Setting environment variable in Ubuntu 10.4
FileNotFoundException is thrown when i try to read a file?
reading a file located on the server