0

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?

1
  • try "/jar_dir/*.jar"? Not sure if it works Commented Jan 29, 2014 at 7:44

2 Answers 2

1

what I would do

import glob

...

";".join(glob.glob(INSTALL_PATH+"/jar_dir/*.jar"))
Sign up to request clarification or add additional context in comments.

2 Comments

This worked... But i came acroos an issue. I have to keep the order of few jars. Right now its setting as I wanted but I don't want to take any risk. Any ideas ?
the problem there is no way to know which order keep except if it is alphabetic or by time creation
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.