$JAVA_HOME not recognized in rpm install script
===

I am having trouble getting my install script to recognize my $JAVA_HOME environmental variable. From my command prompt, I'm able to run `java -version` or `which java` or `echo $JAVA_HOME` and see exactly where java is located. I've set the `$JAVA_HOME` path in `/etc/profile` and pointed the `$PATH` to `$JAVA_HOME/bin`.

I've created an rpm file and was trying to install it however, when I attempt to access `$JAVA_HOME` in my install script (install_script.linux), it seems like all the environmental variables are reset. 

In my install script I'm basically checking for JAVA_HOME like so:

    if [ -n "$JAVA_HOME"] then; 
       do something
    fi

I attempted to print out `$PATH` and I'm getting the default `$PATH` output, not the one I set in `/etc/profile/`

    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin

instead of:

    PATH=$JAVA_HOME/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin 

where $JAVA_HOME=/path/to/my/java/directory

Why is $JAVA_HOME recognized outside of the script but not in the script?

Thanks!