WLST os.getenv Not Working (Doc ID 1349711.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version: 10.3.2 and later   [Release: and later ]
Information in this document applies to any platform.

Symptoms

WLST is not able to retrieve operating system environment variables using the os.getenv command.

Steps which reproduce the issue:

  1. Open a terminal session to the admin server.
  2. cd $DOMAIN_HOME/bin
  3. Execute the following command:
    . ./setDomainEnv.sh
    (dot space dot slash)
  4. Execute the following command:
    java weblogic.WLST
  5. Within WLST issue:
    WLST> import os
    WLST> test=os.getenv("JAVA_HOME")
    WLST> print test

This does not return any information. If the os.getenv is replaced by System.getenv, however, it works as expected.


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms