My Oracle Support Banner

WLST os.getenv Not Working (Doc ID 1349711.1)

Last updated on MARCH 09, 2020

Applies to:

Oracle WebLogic Server - Version 10.3.2 and later
Information in this document applies to any platform.


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:
    . ./
    (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.


To view full details, sign in with your My Oracle Support account.

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

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.