To reiterate what @martin_mueller said:
typically NO path statement takes wildcards
typically you'll need a symlink to point to the correct one
you're on Enterprise Linux: you'll have the links managed for you when you install the proper package,
your JAVA_HOME is just /usr/lib/jvm/jre and it never changes
so, simply
install -m755 <(echo export JAVA_HOME=/usr/lib/jvm/jre) /etc/profile.d/javahome.sh
.. and you're done.
Extra credit: add that into the RPM you use to pull in the JRE, but remember that we don't have a yum repo yet so don't link in db-connect as a dependency if you do.
(Check out https://answers.splunk.com/answers/33933 for the trivial repo question; it shouldn't be long, now)
... View more