What are the differences between Java and JavaScript?

JavaScript is, as the name suggests, a scripting language, developed originally by Netscape. Java is an object-oriented programming language, requiring compilation before it can be run.
JavaScript is used mainly to provide greater user interactivity with a web page, allowing the page to respond to user-driven events, such as mouse clicks. It runs in the user's browser.
When Java is used in conjunction with web pages, it either runs on the server, before the page is presented to the user, or in the form of applets, which are programs run with tight security restrictions in the browser.