'How to fix 'ORA-12705: Cannot access NLS data files or invalid environment specified'

I have an error trying to connect to oracle database:

Query execution failed

Reason:
SQL Error [12705] [72000]: ORA-12705: Cannot access NLS data files or invalid environment specified
ORA-02063: preceding line

My platform is a MacOs running obviously over a Mac, try to connect to remote oracle database. How can I fix this problem?



Solution 1:[1]

If you are using SQL Developer you have to follow this steps:

  1. Open SQL Developer package content. Go to Applications, right click on SQL Developer and select "Show Package Contents".
  2. Go to Contents/Resources/sqldeveloper/sqldeveloper/bin/
  3. Open sqldeveloper.conf using a text editor.
  4. Add the following lines:
# Options to avoid "ORA-12705: Cannot access NLS data files or invalid environment specified."
AddVMOption -Duser.language=en
AddVMOption -Duser.region=US
AddVMOption -Duser.country=en
  1. Restart SQL Developer

Solution 2:[2]

If you are here and using any on the Jetbrain Products (Pycharm/IntellJ IDEA/DataGrip)

  1. Open the properties of the connection
  2. Under Advanced, add the line below in the VM Options (without any quotes)

-Duser.language=en -Duser.country=US

Screen shot of the settings path

Solution 3:[3]

If you're using oracle instant client for windows then remove the NSL variable from the windows environment, your issue will be resolved.

Solution 4:[4]

With Maven try to add parameters:

-Duser.language=en -Duser.country=US

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rubenlop88
Solution 2 John Kitonyo
Solution 3 Henry Ecker
Solution 4 stakahop