I have a problem with a batch script that runs a java program, here some key lines of the script:
exeFinder="java -client -classpath './classes:./lib/javacsv.jar' -Xmx7200m Finder.Main ";
runFinder() {
cleanFolders;
$exeFinder $1 $2 $3 > $4;
}
dbName=$1;
k=$2;
n=$3;
outFile="simple_tester-out.log";
runFinder $dbName $k $n $outFile;
I run the script with its arguments:
./myScript.sh testing_7x8.csv 7 8
And I get this:
Error: Could not find or load main class Finder.Main
It looks like a java problem, so I change the line $exeFinder $1 $2 $3 > $4; for echo "$exeFinder $1 $2 $3 > $4"; to get my execution line:
java -client -classpath './classes:./lib/javacsv.jar' -Xmx7200m Finder.Main testing_7x8.csv 7 8 > simple_tester-out.log
And it works like a charm! So I don't know what is happening.
I have checked some questions like this and this, but I can't see anything useful for me.
Thanks for your time, guys
java - client -clas.....directly on the terminal. and the last form works fine. BTW, I have found the problem, or at least a solution.