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


Groups > comp.lang.java.programmer > #39020 > unrolled thread

Where does jshell save things

Started byCecil Westerhof <Cecil@decebal.nl>
First post2019-07-29 20:59 +0200
Last post2019-07-30 20:04 -0400
Articles 5 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Where does jshell save things Cecil Westerhof <Cecil@decebal.nl> - 2019-07-29 20:59 +0200
    Re: Where does jshell save things Arne Vajhøj <arne@vajhoej.dk> - 2019-07-29 19:54 -0400
      Re: Where does jshell save things Cecil Westerhof <Cecil@decebal.nl> - 2019-07-30 07:28 +0200
        Re: Where does jshell save things Eric Sosman <esosman@comcast-dot-net.invalid> - 2019-07-30 07:11 -0400
        Re: Where does jshell save things Arne Vajhøj <arne@vajhoej.dk> - 2019-07-30 20:04 -0400

#39020 — Where does jshell save things

FromCecil Westerhof <Cecil@decebal.nl>
Date2019-07-29 20:59 +0200
SubjectWhere does jshell save things
Message-ID<87lfwgoeez.fsf@munus.decebal.nl>
When I start jshell it remembers the history from previous runs. Where
is this saved?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#39022

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-07-29 19:54 -0400
Message-ID<qho0v8$2j4$1@gioia.aioe.org>
In reply to#39020
On 7/29/2019 2:59 PM, Cecil Westerhof wrote:
> When I start jshell it remembers the history from previous runs. Where
> is this saved?

I believe it uses preferences API.

So it is OS specific.

Windows => registry

*nix => $HOME/.java dir

Arne

[toc] | [prev] | [next] | [standalone]


#39023

FromCecil Westerhof <Cecil@decebal.nl>
Date2019-07-30 07:28 +0200
Message-ID<87d0hsnla8.fsf@munus.decebal.nl>
In reply to#39022
Arne Vajhøj <arne@vajhoej.dk> writes:

> On 7/29/2019 2:59 PM, Cecil Westerhof wrote:
>> When I start jshell it remembers the history from previous runs. Where
>> is this saved?
>
> I believe it uses preferences API.
>
> So it is OS specific.
>
> Windows => registry
>
> *nix => $HOME/.java dir

I already thought about that, but in ~/.java I saw only a fonts
directory. Looking better there is also an .userPrefs directory.
(First time I see a hidden directory in a hidden directory.) The file
I need is:
    ~/.java/.userPrefs/tool/JShell/prefs.xml

I do not like that it is XML, but it is what it is.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#39024

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2019-07-30 07:11 -0400
Message-ID<qhp8li$n76$1@dont-email.me>
In reply to#39023
On 7/30/2019 1:28 AM, Cecil Westerhof wrote:
> [...]   The file
> I need is:
>      ~/.java/.userPrefs/tool/JShell/prefs.xml
> 
> I do not like that it is XML, but it is what it is.

     Since you're using a Unixoid system, just construct a named
pipe that connects to an XML-to-JSON and JSON-to-XML translator.
(For "JSON," substitute your preferred format.)

     Problem solved!  ;-)

-- 
esosman@comcast-dot-net.invalid
Five hundred forty days to go.

[toc] | [prev] | [next] | [standalone]


#39037

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-07-30 20:04 -0400
Message-ID<qhqlts$dd0$1@gioia.aioe.org>
In reply to#39023
On 7/30/2019 1:28 AM, Cecil Westerhof wrote:
> Arne Vajhøj <arne@vajhoej.dk> writes:
> 
>> On 7/29/2019 2:59 PM, Cecil Westerhof wrote:
>>> When I start jshell it remembers the history from previous runs. Where
>>> is this saved?
>>
>> I believe it uses preferences API.
>>
>> So it is OS specific.
>>
>> Windows => registry
>>
>> *nix => $HOME/.java dir
> 
> I already thought about that, but in ~/.java I saw only a fonts
> directory. Looking better there is also an .userPrefs directory.
> (First time I see a hidden directory in a hidden directory.) The file
> I need is:
>      ~/.java/.userPrefs/tool/JShell/prefs.xml
> 
> I do not like that it is XML, but it is what it is.

-Djava.util.prefs.userRoot=.

should move the file to current dir.

And:

-Djava.util.prefs.PreferencesFactory=something

should allow you to use your entirely own preferences repo.

Arne


[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web