Link to home
Start Free TrialLog in
Avatar of dmaguillo
dmaguillo

asked on

Obtain data from environment vars

Hi real-genius.

How could i obtain data from Sun/Solaris environment variables?
We are development a java server (CORBA-JDBC), and need access to the information content in an environment system variable (Argsss, my english!).

Bye... :)
ASKER CERTIFIED SOLUTION
Avatar of Jim Cakalic
Jim Cakalic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ravindra76
Ravindra76

HI,
You can define environment variables and in the java program you can access the value also.
Do like this:
First set environment variable
like this
set DMV_HOME=jdbc:odbc:mysource
And then in the prorgam you can the value of this environment variable like this
String dmvhome=System.getProperty("DMV_HOME");
But when you run the program you have to pass the environment variable to the program
using -D option
java -DDMV_HOME="%DMV_HOME%" GetProperty
Assume that my program name is GetProperty.java;
Avatar of dmaguillo

ASKER

Thanks...