03月07, 2018

WebLogic Failed to get environnement 错误

Initializing WebLogic Scripting Tool (WLST)

     [java] Initializing WebLogic Scripting Tool (WLST) ...
     [java] 
     [java] Welcome to WebLogic Server Administration Scripting Shell
     [java] 
     [java] Type help() for help on available commands

错误

Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified.')

得到正确的系统版本

print (System.getProperty( "os.name" ))

并修改 "wlserver_10.3\common\wlst\modules\jython-modules.jar"

Windows 8

    _osTypeMap = (
        ( "nt", ( 'nt', 'Windows NT', 'Windows NT 4.0', 'WindowsNT',
                  'Windows 2000', 'Windows 2003', 'Windows XP', 'Windows CE',
                  'Windows 8', 'Windows Server 2008', 'Windows 7', 'Windows 10' )),
        ( "dos", ( 'dos', 'Windows 95', 'Windows 98', 'Windows ME' )),
        ( "mac", ( 'mac', 'MacOS', 'Darwin' )),
        ( "None", ( 'None', )),
        )

打包命令 'jar.exe uf jython-modules.jar Lib\javashell.py'

重新放入 ok

本文链接:https://blog.qfdk.me/post/WebLogic Failed to get environnement 错误.html

-- EOF --