Solved

Obtain data from environment vars

Posted on 2000-04-07
3
216 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 50 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now