If you are using Oracle Java you need to install the JDK not the JRE to stop this message. You can check by going to terminal and typing java -version and you should see something like this:Right. However, I just used the link that someone put in this forum for the Java download specifically for safari OS X and I am no longer having an issue with the Java box popping up.
Last login: Wed Jan 7 21:51:37 on console
adams-mbp:~ adam$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
adams-mbp:~ adam$
If you only install the JRE you will find the command java -version is unknown see https://java.com/en/download/faq/java_mac.xml. JDK is not required for Java in browsers but is for Java applications you may be running - or at least for the one Java application I am running