I presume you're not typing in a command in Terminal. Otherwise, some script or program requires Java to run. Are you clicking to open a program and the popup happens there or does it just pop up at random?
Java used to be a part of the OSX installation. It no longer is. Did you upgrade to a new OSX version or install some new software? Or has this been happening for a while and now is the time you've decided to deal with it?
If you know what program requires Java, the easiest path is to not use that program. Some Adobe programs require Java and the wrinkle there (I think) is that it requires an older version of Java. Some programs used what was called the "Java Application Stub" which made the Java program have more of a OSX look and feel, vs. the look and feel of Java - but the Java Application Stub is no longer supported so the program needs to be run without it. The Java runtime software is free and can be downloaded.
If you know the answers to these questions, suggestions can be made as to how to remedy the issue. It would also be helpful if you press the "More Info" button on the screenshot you posted. What comes up may be useful.
So, did you click the "more info" button as it instructs?
BTW, what are you doing when this message pops up?
https://www.java.com/en/download/faq/yosemite_java.xml....
SYMPTOMS
Even after upgrading to the latest version of Java, while running some applications on OS X 10.10 (Yosemite) or OS X 10.11 (El Capitan), users see a dialog box prompting to download Java.
OS X 10.11 (El Capitan) message:
To use the "java" command-line tool you need to install a JDK
OS X 10.10 (Yosemite) message:
To open "application" you need to install the legacy Java SE 6 runtime.
CAUSE
This is most commonly because an application requires the legacy Java 6 provided by Apple. For the solution to this issue, see http://support.apple.com/kb/DL1572
....
It randomly pops up. And I am have had it since I upgraded my Java a while back. I haven't clicked more info. I just click okay and it goes away and then it comes back later.
This sounds so confusing. Sorry. I'm not that computer savvy. I do have chrome.A couple of the programs that was given as possible instigators of the popup is Chrome and Facebook video-chat. Do you use those programs?
In System Preferences, is there a pane for Java? (It would be on the last row.) If there is a pane, open the "Terminal" application, click "Shell", then "New Command ..." and type it "java -version". If both the Java Pane is there and you get some information back from the "java -version", then you likely have the issue where some program wants the older Java version. If you have neither the Java Pane and the "java -version" command says "Command not found" or something similar, it means that something has gone wrong with your previous Java installation - perhaps you upgraded (not updated) the OS after you last installed/upgraded Java. I've also read that El Capitan (maybe Yosemite as well?) will no longer will allow non-Apple versions of Java below a certain level.
If you don't want Java anymore, you will need to find out what program is asking for it and either not use it or find out what can be done so it doesn't ask for Java.
According to Oracle FAQs, you might have an app that requires a legacy version of Java --
https://www.java.com/en/download/faq/yosemite_java.xml
Also see the Apple support link in the above quote.
EDIT to add standard warning -- Because of added security vulnerabilities, if it can be avoided, it's best to not use Java.
I just did that now I have the upgraded version. Let's see if it works better now.Try installing Java Development Kit from Oracle's site. Java site just gives you the browser plugin.
https://www.java.com/en/download/faq/develop.xmlWriting Java applets and applications needs development tools like JDK. The JDK includes the Java Runtime Environment, the Java compiler and the Java APIs. It's easy for both new and experienced programmers to get started. ....
https://support.google.com/chrome/answer/6213033.....In the past, many plugins were developed using an old system called NPAPI. Today fewer sites are using NPAPI plugins and they have often caused security risks on websites.
To make browsing with Chrome safer, faster, and more stable, we stopped allowing NPAPI plugins on September 1, 2015.
Plugins that use NPAPI, including Silverlight, Java, and Unity, won’t work.....
https://www.java.com/en/download/faq/chrome.xml.....Java applications are offered through web browsers as either a web start application (which do not interact with the browser once they are launched) or as a Java applet (which might interact with the browser). This change does not affect Web Start applications, it only impacts applets.
If you have problems accessing Java applications using Chrome, Oracle recommends using Internet Explorer (Windows) or Safari (Mac OS X) instead.....