Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Obtain data from environment vars

Posted on 2000-04-07
3
Medium Priority
?
224 Views
Last Modified: 2006-11-17
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... :)
0
Comment
Question by:dmaguillo
3 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 150 total points
ID: 2693851
Take a look at this page: http://my.ispchannel.com/~flee/software/index.html. You will find there the source for an EnvProperties class which I think will suit your needs.

Best regards,
Jim Cakalic
0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2694878
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;
0
 
LVL 1

Author Comment

by:dmaguillo
ID: 2703327
Thanks...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question