문제

I've found many answer about the python way but what I found isn't working with jython.

I'm running a jython script using the WebSphere interpreter wsadmin -lang jython -f /path/to/script

I'd like to know the path of the script im running. This script if versionned and can be checked out anywhere so I need to reliably know where the script is being executed from.

Thanx to everyone

도움이 되었습니까?

해결책

WebSphere doesn't make this easy. And I've yet to find a way to do this when using Sun's JVM running WebSphere on Solaris. However, you may be able to figure out the script name using the environment when running WebSphere on Linux, Aix and possibly others OSes. On these platforms, IBM's JVM sets the environment variable IBM_JAVA_COMMAND_LINE. You can parse it to get the '-f' argument passed to wsadmin.sh Dave Brand has code to do this on his blog. See fix #6 in his ibmfixes.py script.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top