Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2003, 02:57 PM
Authorized User
 
Join Date: Jul 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to get env variable values?

Hi all

Can any one tell me how to get the environment variable in java from the unix box??

thanks in-advance
suri

 
Old September 20th, 2003, 05:34 PM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to yasir_lahham
Default

try this code, it should print the property name= value

import java.util.Enumeration;

public class Sys {

    public static void main(String[] args) {
    Enumeration enm=System.getProperties().keys();
    while (enm.hasMoreElements()){
      String prop=enm.nextElement().toString();
      System.out.println(prop.concat("= "+System.getProperties().getProperty(prop)));
    }
  }
}


MHD Yasir Al-lahham





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping down variable values mellan XSLT 1 September 19th, 2005 09:00 AM
How to parse env variables zoostar XML 3 April 1st, 2005 06:00 AM
Window.open from OnClick event in framed env. nancy Javascript How-To 3 December 22nd, 2004 11:30 AM
Using .NET classLib in VB6 env aslyon General .NET 1 September 27th, 2004 09:36 AM
How to add two variable with Decimal values sa_moizatyahoo ASP.NET 1.0 and 1.1 Basics 1 April 3rd, 2004 06:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.