OK, I'd guess that Bash on OSX is the same, or very nearly identical, to Linux Bash, but this is just a (semi-)educated guess; I've never used OSX so I can't say for sure.
So.. Everything works fine when the folder exists on your desktop; but you want the script to still work if, let's say, the javaTest folder is located somewhere else instead of on your desktop?
The following depends on there being ONLY ONE file "startMother" on the machine.
MOTHERFILE=$(find / -type f -name "startMother" 2>/dev/null)
javac -classpath core.jar Mother.java
java -classpath .:core.jar Mother
So, I tested the above on my machine. I created the Users/acid/... directory path, and made a startMother file that just echoed some crap to the screen. The above script found and executed it, from my home directory/desktop.
I copied the above script to a different location on the machine, and tried it again. It worked. It should also work if the javaTest folder is somewhere else, because this script ONLY looks for the "startMother" file, and cd's to that directory.
I dumped 2>/dev/null because if you are an unpriveleged user, a whole tonne of errors will appear if you do not have permission to search for the file in many locations on a given machine.
And remember: this depends on there being ONLY ONE startMother file on the machine. If there are more than one, weird things will probably happen (which you should error-check for), and also, if no such file is found, the script will fail (which you should also error-check for this occurrence).
So, does this work for you, and do what you want?