Any attempt at a script a cd should ensure that the command is run in the current shell. Otherwise, if it is running in the child shell, it will not work as you need, since the current working directory of the parent will not be changed.
GNU find has -printf, which you can use to print the directory of any found files. The search result can be passed to cd using Command Substitution.
cd $(find . -name Subscription.java -printf '%h\n')
cd (in bash) ignores additional arguments, so if multiple files are found, cd will change to the directory of the first file found.
source share