Process Id and Environment variables

How do I print the current process ID in JAVA 1.5.0 using WIN 2000?How do I print a list of the Environment variables in JAVA 1.5.0 using WIN 2000?
[161 byte] By [sportnfan] at [2007-9-30 18:14:25]
# 1

Environment variables are an Operating System dependant concept. Because Java is OS independant it has no way of accessing environment variables. About as close as you are going to get is setting System Properties on the command line when invoking the JVM.

Obtaining the PID is also an Operating System concept that is not supported directly by Java. I have however seen it done using native JINI calls to a .dll. Now that I think of it, I bet the same can be done to get to the environment variables.

carr_onstott at 2007-7-6 18:46:33 > top of Java-index,Java Essentials,Java Programming...
# 2
In 1.5.0, I can use the system.getenv method to find out the contents of an environmental variable however I can't print a list of the variable names themselves.
sportnfan at 2007-7-6 18:46:33 > top of Java-index,Java Essentials,Java Programming...
# 3
System.getenv() is deprecated (for quite a while now).
cknelsen at 2007-7-6 18:46:33 > top of Java-index,Java Essentials,Java Programming...
# 4

System.getenv() is not deprecated for Java 5 (or rather it has been undeprecated):

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getenv()

Let's move this discussion to http://forum.java.sun.com/thread.jsp?forum=31&thread=556864&tstart=0&trange=15

These double posts are an evil thingie ...

thomas.behr at 2007-7-6 18:46:33 > top of Java-index,Java Essentials,Java Programming...