Re: Static Variables -- How Persistant are They?

From: Brad BARCLAY (bbarclay_at_jsyncmanager.org)
Date: 10/01/03


Date: Wed, 01 Oct 2003 14:55:31 GMT

Hal Vaughan wrote:

> Okay -- I've tried this and if I set the property and get it in the same
> program, it's there. If I set it, then run a program to read it, it isn't
> there -- in other words it is not persistant. Is there something special I
> have to do to create a new property and make it persistant?
>
> Which leads to something similar. I had problems creating persistant fields
> in the Preferences class until I changed read/write permissions in some
> directories in my /usr/java directory (I'm using Linux and Java 1.4.1). Is
> there some kind of bug in the setup program that does not set permissions
> so Java programs can create persistant Preferences fields? (It did fine
> when I ran it as root.) I ran my program to set a property as root, and it
> made no difference.

        Properties are not automatically persistant -- you have to write the
properties to disk before exiting if you want to save them. Otherwise,
properties only live for the lifetime of the JVM they're created in.

        HTH!

Brad BARCLAY

-- 
=-=-=-=-=-=-=-=-=
 From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project:  http://www.jsyncmanager.org