Java and Javascript seem very similar in name and one might be tempted to believe that they are in fact the same thing. However, Java and Javascript are two different things. Java runs on many platforms while Javascript only runs on a specific browser.
Java will create applications that run in a virtual machine or browser while javascript code is run on a browser only. Java codes will need to be compiled but Javascript will already all be in one text. Javascript does not create standalone applications like Java does and the two also require different plugins from one another to run.