I not too fond of off-topic posts, but...

You can't get to the environment variables with pure Java for security
reasons - it was taken out of the API a while ago. If you want to pass
environment information in you'll have to provide -D<variable-name>=<value>
to the java executable, then you can use System.getProperty().

javah will generate C stubs for methods marked using the "native" keyword,
for making calls from java to C. You could always build a bridge to a
library and then call getenv() from the standard C libraries.

If you're working in Win32 then you could write a COM component which
exposes the information you need and use J-Integra (no I don't work for
them) to get access to it from Java.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Ravi Prakash
Sent: 06 March 2001 17:52
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: how to get values for environment variable using java


Hi,

I know it is out of forum, Any one please help me get the environment
variables and also to call C API 's in java.  I think it can be done
with JNI interface, do i want to change the C API's so that they can be
called in java.
Suggestions apprecieate,

thx in advance
ravi

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to