A pop-up message about Java may well be malware; clicking on a link from it could invite something very nasty onto your computer.
However Java is useful. Go here. (Do it now. Don't wait for any messages about it):
https://www.java.com/en/download/
Click on 'Do I have Java?' If you see the words 'Active Java Platform' you don't need to do anything. If not, go back to the first page and click the big red button.