Question

I new to Python and am looking for a way to create my CLASSPATH argument for Jython script in wsadmin for Websphere, by reading from a folder and including all jars in that folder.

Example :

/jar_dir
    1.jar
    2.jar
    ...
    70.jar

CLASSPATH= INSTALL_PATH + "/jar_dir/1.jar;" + INSTALL_PATH + "/jar_dir/2.jar;"  .... INSTALL_PATH + "/jar_dir/70.jar;" 

How can I do this?

Was it helpful?

Solution

what I would do

import glob

...

";".join(glob.glob(INSTALL_PATH+"/jar_dir/*.jar"))

OTHER TIPS

The correct way to do this would be: [1] Adding the jars to "com.ibm.ws.scripting.classpath" to your wsadmin.properties file. See This.

[2] Or add the switch "-wsadmin_classpath /path/to/jar" when you call wsadmin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top