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