View previous topic :: View next topic |
Author |
Message |
vyom n00b
Joined: 21 Jun 2003 Posts: 5
|
Posted: Sun Sep 05, 2004 6:50 am Post subject: Shell Scripting Help |
|
|
I have been trying to google this for a while, and i need it quite urgently.. so I am posting here.
I am working with Java on linux and i need to add a bunch of jar files in a folder to the classpath. The shell script that launches the Java app has to source a bunch of Jar files in a folder, say ./lib/java relative directory.
How do i append all these jar files in a single variable CLASSPATH and then subsequently launch the program.
Thanks a lot in advance..
Regards
Deepak _________________ Carpe Diem |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Sep 05, 2004 6:54 am Post subject: |
|
|
You mean like export CLASSPATH="/usr/lib/java/jar1:/usr/lib/java/jar2"? _________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
vyom n00b
Joined: 21 Jun 2003 Posts: 5
|
Posted: Sun Sep 05, 2004 7:07 am Post subject: |
|
|
Yes, but I need to do this dynamically, since I cannot keep modifying the script, and Jar files may be added at a later date. _________________ Carpe Diem |
|
Back to top |
|
|
nephros Advocate
Joined: 07 Feb 2003 Posts: 2139 Location: Graz, Austria (Europe - no kangaroos.)
|
Posted: Sun Sep 05, 2004 4:13 pm Post subject: |
|
|
You mean like this?
Code: | for F in ./lib/java/*jar
do
CLASSPATH=${CLASSPATH}:$F
done |
_________________ Please put [SOLVED] in your topic if you are a moron. |
|
Back to top |
|
|
|