Good, that’s progress. Scanning the source is working and we entered the actual Java code.
Now it seem the target file is not properly set.
You could add echos to the loop body:
To see how the variables are set
sourceFile="$(realpath "$F")"
echo ${sourceFile}
targetFile="${targetDirectory}/${targetFilePrefix}_$(removeExtension "$(basename ${F})").dim"
echo ${targetFile}
echo "${gptPath} ${graphXmlPath} -e -p ${parameterFilePath} -t ${targetFile} ${sourceFile}"