#!/bin/sh

this_dir=`dirname "$0"`
ix=$this_dir/..

web_services=/local/share/java/jwsdp/jwsdp-1.1/

cpath=$ix/java:$ix/java-ide

# Put all the usual I-X required .jar files in imports in the CLASSPATH

cpath=$cpath:`echo $ix/imports/*.jar | tr " " ":"`

# App-specific classpath /\/

cpath=$cpath:apps/mm-client/java

# Put all web services .jar files in the CLASSPATH

# /\/: Used to include all */lib/*.jar, but now just use some
# selected ones.
#
# cpath=$cpath:`echo $web_services/*/lib/*.jar | tr " " ":"`

# /\/: Not clear the common/lib stuff is needed
# cpath=$cpath:`echo $web_services/common/lib/*.jar | tr " " ":"`
extensions=$web_services/common/lib

cpath=$cpath:$web_services/jwsdp-shared/lib/mail.jar
cpath=$cpath:$web_services/jwsdp-shared/lib/activation.jar
cpath=$cpath:$web_services/jaxr-1.0_03/lib/soap.jar

endorsed=$web_services/jaxp-1.2.2/lib/endorsed

# Now run

env CLASSPATH=$cpath:$CLASSPATH \
  java -Djava.endorsed.dirs=$endorsed \
       -Djava.ext.dirs=$extensions \
       "$@"
