Running a .sh file but after new PATH is not visible in shell
You can't run a script to set the path in your current shell. In your case this does not  seem to be necessary anyway because all the script does is to set up the correct variables to run the java process at the end. So inside this process all environment variables should be set correctly.

To set variables in the current shell, either set them in .bashrc/.bash_profile and open a new shell; or duplicate your script, remove the last line and source the new script into the shell with . path/to/new/script.