Sound will be played by asterisk server.
So if your java server on other machine, you need copy file before plaiing to asterisk server or use network filesystem(nfs, gluster fs etc)
If your java work on same physical server, you can specify any file on that server. Just need give full path to asterisk and ensure asterisk user can access that file.