I am doing this in a script:
if [ -d $SERVICE_HOME/../config ]; then
CLASSPATH="$SERVICE_HOME/../config:$CLASSPATH"
fi
And the /config folder has sub-folders in it also, will files in the subfolder be added to the classpath?
The answer depends on the content of the folder.
The hierarchy below the folder is a one-to-one mapping to the package structure of your classes.
E.g. the file ./org/example/MyClass.class
will be used for the class org.example.MyClass
.
These files will be ignored, because a jar file has to be explicitly added to the classpath.
E.g. CLASSPATH=${CLASSPATH}:${SERVICE_HOME}/mylib.jar
CLASSPATH+="$SERVICE_HOME/../config"