Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAVA_TOOL_OPTIONS incorrectly picked up

BG4GRAPHAug 14 2020

Hi everyone,

in order to get appropriate locale settings I try to configure sqlci by "set JAVA_TOOL_OPTIONS='-Duser.lang=de -Duser.country=DE -Duser.timezone=Europe/Berlin -Dfile.encoding=ISO-8859-1'". As expected sqlci responds by "Picked up JAVA_TOOL_OPTIONS: '-Duser.lang=de -Duser.country=DE -Duser.timezone=Europe/Berlin -Dfile.encoding=ISO-8859-1'". Not trusting things I prefer to check using the script

script

  var System  = Java.type("java.lang.System");

  System.out.println( System.getProperty("user.lang"));

  System.out.println( System.getProperty("user.language"));

  System.out.println(  System.getProperty("user.region"));

  System.out.println(  System.getProperty("user.country"));

  System.out.println(  System.getProperty("user.timezone"));

  System.out.println(  System.getProperty("file.encoding"));

/

The output is:

de -Duser.country=DE -Duser.timezone=Europe/Berlin -Dfile.encoding=ISO-8859-1

de

null

DE

Europe/Berlin

Cp1252

See what has happened? The various properties should have been broken along white space boundaries, but instead everything is pushed into user.lang. On the other hand file.encoding is definitely wrong.

I tried with java 1.8.0_261. I do have other jdks on my system, but sqlci seems to have her own ideas of which one to choose.

Can anything be done about the java options? I would be thankful for every idea.

Yours,

user8632123.

This post has been answered by user13708755 on Nov 6 2020
Jump to Answer

Comments

user13708755
Answer

Isn't this caused by the single quotes you have in the variable definition? I have been using the JAVA_TOOL_OPTIONS environment variable with SQLcl without any issue for years.

Marked as Answer by BG4GRAPH · Nov 6 2020
BG4GRAPH

Alright. No quotes at all, and it works. I hadn't thought of that! Thanks!

1 - 2

Post Details

Added on Aug 14 2020
2 comments
5,822 views