Setting an environment variable from another environment variable

M

marcwentink

Dear group,

In the java executable startup, can I do something like:

-Dresin.home=$RESIN_HOME or
-Dresin.home=%RESIN_HOME%

hence letting resin.home be equal to the value of the other
environment variable RESIN_HOME?

Marc
 
M

Michael Rauscher

Dear group,

In the java executable startup, can I do something like:

-Dresin.home=$RESIN_HOME or
-Dresin.home=%RESIN_HOME%

hence letting resin.home be equal to the value of the other
environment variable RESIN_HOME?

Sure.

Bye
Michael
 
M

marcwentink


Great, works, tested it! Isn't life wonderful!

import java.util.*;
public class TestProps
{
public static void main(String[] args)
{
Properties p = System.getProperties();
p.list(System.out);
}
}

P:\Magdalena\school\Java\certificatie>java -Dresin.home=%RESIN_HOME%
TestProps
-- listing properties --
.....
resin.home=C:\java\resin-3.0.18
 
M

marcwentink

Didn't you test it before posing the question?

No....

I was just browsing and searching and found this java properties class
after posing the question. I did search in google before posing the
question though, but I could not find it. I hope you're not going to
flame me now?
 
L

Lew

No....

I was just browsing and searching and found this java properties class
after posing the question. I did search in google before posing the
question though, but I could not find it. I hope you're not going to
flame me now?

No, of course not! Gods forfend!

I was just wondering.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top