Solved

Obtain data from environment vars

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 104
Arrays.asList  VS  ArrayList 4 71
table example 4 32
ejb message driven bean mdb creation steps 2 15
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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.

792 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