Javascript is used in web pages for lots of things - but it's executed on the fly, so can do things like alter the content of pages dynamically (without reloading) and check the validation of forms. It's also used as a key part of AJAX which is used in lots of modern sites (think facebook chat and so forth.)
Java is something entirely different, it's an object oriented programming language that can be used to build huge applications. Google uses it a lot, most of their products are powered by Java as are all the android phones / tablets. It's a huge technology that can be applied to many areas, Java applets are often used for games (which is probably what was being referred to above) Java servlets are used as a server side language (much like PHP is used) Java ME used to be used for mobile devices - there's loads out there.