How to specify System Properties when launching JShell?

Brian Oliver brian.oliver at oracle.com
Wed Mar 8 17:41:04 UTC 2017


Hi Robert,

Thanks for getting back to be so quickly.   It worked perfectly!

Next step is to see if I can do some remote lambdas across a distributed collection (aka: Coherence)

— Brian

> On Mar 8, 2017, at 12:14 PM, Robert Field <robert.field at oracle.com> wrote:
> 
> Hi Brian,
> 
> JShell executes user code in a remote process.  To send arguments to that remote process use the “-R” flag.
> 
> So, if you would launch:
> 
>    java -Djava.net.preferIPv4Stack=true MyProg
> 
> Then you would launch the jshell tool with:
> 
>    jshell -R-Djava.net.preferIPv4Stack=true
> 
> See:
> 
>    jshell —help
> 
> Hope that helps,
> Robert
> 
>> On Mar 8, 2017, at 4:23 AM, Brian Oliver <brian.oliver at oracle.com> wrote:
>> 
>> Hi All,
>> 
>> I’m starting to use JShell (awesome btw) but can’t find any documentation on how to specify a system property on start up.
>> 
>> Specifically I want to set:
>> 
>> 	java.net.preferIPv4Stack=true
>> 
>> While I can specify a system property by invoking:
>> 
>> 	System.setProperty(…);
>> 
>> This basically ignores all JVM-level properties.
>> 
>> Ideally I’d like to specify them when setting up the environment, but it’s not clear how to do this.
>> 
>> Thanks
>> 
>> — Brian
>> 
>> PS: My apologies if this has been answered, but I can’t find it or any documentation on the subject.
>> 
>> Brian Oliver | Architect | brian.oliver at oracle.com
>> Oracle Coherence Development
>> 35 Network Dr | Burlington, MA 01803
>> 
>> 
>> 
> 



More information about the kulla-dev mailing list