Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #3302

Re: Where are Java System Properties stored?

From Joerg Meier <joergmmeier@arcor.de>
Newsgroups comp.lang.java.help
Subject Re: Where are Java System Properties stored?
Date 2015-04-21 12:12 +0200
Message-ID <bqk5gi5ujmn3.vkxsgy5lcog9.dlg@40tude.net> (permalink)
References <badfak$bgs$1@zcars0v6.ca.nortel.com> <8qrlcvgc8gjjd8bssb737dml87oitov4ih@4ax.com> <d93b7dfe-6203-4124-bb1b-ecea77a7ae9e@googlegroups.com>

Show all headers | View raw


On Tue, 21 Apr 2015 00:52:37 -0700 (PDT), khushankkashyap9@gmail.com wrote:

> For the above query i wanted to know whether i can access the system property explicitly through following code:
> Properties p = System.getProperties();
> 		p.put("check_value", "true");
> 		System.setProperties(p);

> now the property is returning null when i access it in different process/application with 
> System.getProperty("check_value").

> is there any way by which we can set the system property which is accessible to all the processes

That is not possible in Java. Your only solution as far as I know is to
call an external program, such as the system shell, and use that to set
environment variables. Java only holds a copy of the properties, so no
matter what tricks you try, you will not be able to affect the outside
world.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar


Thread

Re: Where are Java System Properties stored? khushankkashyap9@gmail.com - 2015-04-21 00:52 -0700
  Re: Where are Java System Properties stored? Joerg Meier <joergmmeier@arcor.de> - 2015-04-21 12:12 +0200

csiph-web