reading env variables in solaris

J

__jakal__

Hello,
How can I read the environment variable in solaris in java.
I use java 1.4 SDK
 
C

Christophe Vanfleteren

__jakal__ said:
Hello,
How can I read the environment variable in solaris in java.
I use java 1.4 SDK

You can't. You'll be able to do this (again) in JDK 1.5 though.

For now, pass properties using the java -Dpropertyname=propertyvalue syntax.
 
A

Andrew Thompson


OK.. Just testing something..
<http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#[email protected]>

[ that always bugs me, the '('
...wonder if above'll work? ]
It is the only method that I know of to ever get undeprecated(?) in the JRE.

I was about to jump in with
ServletRequest.getParameter(String),
till I noticed 'in the JRE'.. ;-)
 
T

Thomas Weidenfeller

Christophe said:
It is the only method that I know of to ever get undeprecated(?) in the JRE.

If I am not mistaken, (part of) PrintStream was once deprecated and got
undeprecated fast, because Sun figured out that you needed it for
System.out and System.err.

/Thomas
 
R

Roedy Green

Hello,
How can I read the environment variable in solaris in java.
I use java 1.4 SDK

getEnv is deprecade, but probably still alive.
Failing that, JNI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top