why isn't my environment variable visible from the command line?
The issue is that you are not running in your environment so any changes to ~/.bash_profile will have no effect on the command. It will be visible to other processes 

sudo runs as another user - in this case root as you have not provided a -u username parameter. Thus you need to change the root environment to make JAVA_HOME visible to the run.sh command