Java was developed by Sun microsystems, as a full-featured, object-oriented programming language to build full cross-platform applications.
JavaScript was originally developed by Netscape and called LiveScript; in order to let web designers do more in web pages. Officially it's called ECMAScript. JavaScript was a later change.