• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

environment variable :urgent

 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can i check my own environment variable from java code ?
Thanks in advance!
------------------
"Sun Certified Java Programmer"
KS
"Failing to plan is like plannig to fail!"
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the System.getProperties method. Of course it will only get Java and general stuff. Anything TOO related to the operating system is not available in this.

[This message has been edited by Cindy Glass (edited March 05, 2001).]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can see your environment variables using java.util.Properties. I am not sure, but I think you can.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
U can also do it indirectly by using Runtime.exec. You can execute the cmd.exe (in NT) or command.com (Win 9x). You can capture the output of DOS command env using a Reader and then extract the info. from that.
Madhesh
 
Kalpesh Soni
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys
May be i ll write a small C program and exec it through java
regards

------------------
"Sun Certified Java Programmer"
KS
"Failing to plan is like plannig to fail!"
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic