By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,290 Members | 1,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,290 IT Pros & Developers. It's quick & easy.

Check if files specified in java -classpath exists or not

P: 1
Hi

I have a UNIX script which creates a report. In that script I have to define the java classpath. Also I need to check if the java classpath specified exists or not. Below is the command i use

XY=./abc/cde:./bgh/nkl
# check if path defined in $jXY exists
IFS=:
for i in $XY
do
if [ -f $i ]
then
echo $i
else
exit
fi
done
java -classpath.:$XY <parameters to create report>

When i run this without checking whether path exists or not, the report is generated, but when i include the statements to check for existence of path in $XY, i am getting the error "./bgh/nkl is missing the manifest file entry"
But it actually has the manifest entry. I want to know how the check for existence of path can affect the generation of report in the java -classpath statement.
Feb 4 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.