How to copy files with a file extension from multiple folders?

I have to copy files with a .tmt extension to a folder(ex: \main\allfiles\) from many sub folders under /individualfiles/1/, /individualfiles/2/, /individualfiles/abc/, /individualfiles/xyz/ ... /individualfiles/zzz/.
My issue is after copying all files from one folder, I have to run a java command and then copy again from the next folder and then run the java command again. 
We do a copy file by file. After the first file gets copied from /individualfiles/1/, we copy the next file from /individualfiles/1/ and then we go to the next folder /individualfiles/2/ and again copy files individually. 
Please let me know how to run the java command after all files have been copied from a folder.

You can accomplish this by stringing together a hand full of linux command line utilities.
Something like this,
find . -iname "*.tmt" | xargs dirname | uniq | xargs -I{} sh -c "cp -u {}*.tmt /destination/path && java command.jar"

How it works,

find . -iname "*.tmt" gets all the relative paths with filename of the .tmt type from where you run this and the subfolders
xargs dirname removes the files name leaving you with a list of the relatively pathed directories
uniq removes duplicate directories
xargs -I{} sh -c "cp -u {}*.tmt /destination/path && java command.jar" runs a sh script that copies all .tmt files in the list of directories with .tmt files to a destination folder and if the copy is successful runs java command.jar which should be replaced with your java command.

Edit:
If your goal is to copy 1 file at a time and then run a command after each file is copied that actually simplifies things. The above commands can be reduced to 1 and 4 or this.
find . -iname "*.tmt" | xargs -I{} sh -c "cp -u {} /destination/path && java command.jar"

This takes every file with the .tmt extension found with find and runs a script to copy and run java command.