Invoking Jython without Weblogic's WLST

你离开我真会死。 提交于 2019-12-07 21:50:24

问题


I'm using an AIX machine which has Weblogic 9.21 installed and it also has jython as part of its installation (WLST).

Is there a way to run jython code without having to initialize the WLST first?

I have the following jars too if they bring in any ideas:

['.', '/opt/weblogic921/weblogic92/common/lib/jython.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/common/lib/config.jar', '/opt/weblogic921/weblogic92/server/lib/weblogic.jar', '/opt/weblogic921/weblogic92/common/wlst/modules/jython-modules.jar/Lib', '/opt/weblogic921/weblogic92/common/wlst', '/opt/weblogic921/weblogic92/common/wlst/lib', '/opt/weblogic921/weblogic92/common/wlst/modules']

Right now I'm invoking the jython code using:

java -cp /opt/weblogic921/weblogic92/server/lib/weblogic.jar weblogic.WLST file.py

回答1:


Paste below code in a shell script say jythonExec.sh and use it

Example Usage : /bin/bash jythonExec.sh file.py

#!/bin/bash 
jythonJarLoc=/opt/weblogic921/weblogic92/common/lib/jython.jar
javaLoc=/usr/bin/java
pythonCacheDir=/tmp/pythonCacheDir
if [ ! -f ${jythonJarLoc} ]; then
    jythonJarLoc=/opt/weblogic921/weblogic92/server/lib/weblogic.jar
fi
${javaLoc} -cp ${jythonJarLoc} -Dpython.cachedir=${pythonCacheDir} org.python.util.jython $@


来源:https://stackoverflow.com/questions/12931155/invoking-jython-without-weblogics-wlst

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!