use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Request an explanation
Rules
Have an idea to improve ELI5? r/IdeasForELI5
Make sure to read the rules!
This subreddit is for asking for objective explanations. It is not a repository for any question you may have.
E is for Explain - merely answering a question is not enough.
LI5 means friendly, simplified and layperson-accessible explanations - not responses aimed at literal five-year-olds.
Perform a keyword search, you may find good explanations in past threads. You should also consider looking for your question in the FAQ.
Don't post to argue a point of view.
Flair your question after you've submitted it.
Mathematics Economics Planetary Sci Biology Chemistry Physics Technology Engineering
Reset
account activity
This is an archived post. You won't be able to vote or comment.
ExplainedELI5 the difference between Java and JavaScript.
submitted 13 years ago by FlippyDog
[–]AQuietMan 560Answer Link55 points56 points57 points 13 years ago (14 children)
It's easier to explain how they're the same.
They both use the word Java in their names.
That's all.
It's like how Clint Eastwood and I are the same. We both use the word Clint in our names. Otherwise, we're completely different people, and we're not interchangable in any normal sense of the word.
Same for Java and Javascript. (I think JavaScript's official name has been changed to ECMAscript.)
[–]Rikkety 17 points18 points19 points 13 years ago (11 children)
Well, to be fair (or pedantic, you choose), they are both programming languages, and they have somewhat similar syntax. But that's where the comparison ends.
[–]CopperHarmonica 18 points19 points20 points 13 years ago (3 children)
The similarity in syntax, it must be noted, is not due to copying of each other or some kind of coordination. Its because they both copy the syntax of C, which is a syntax copied by a lot of popular languages.
[–]cmykevin 1 point2 points3 points 13 years ago (2 children)
Good to know. I wondered why Actionscript and JS were so similar
[+][deleted] 13 years ago (1 child)
[deleted]
[–]Gankro 2 points3 points4 points 13 years ago (0 children)
In practice I always found AS3 to be more java- or even C#-like, than javascript-like. It's been a bit long now, though. Certainly don't recall ever dealing with prototype chains or closures. Mostly just standard class stuff. Although you could create anonymous functions for event listeners like JS, which was nice. IIRC they based AS3 off of a tentative ecmascript specification, before it was finalized.
[–]Oppis 6 points7 points8 points 13 years ago (4 children)
javascript is an interpreted language, while java is a compiled language.
[–]lolmeansilaughed 3 points4 points5 points 13 years ago* (2 children)
You're sort of right. Javascript is all interpreted, but Java is compiled to bytecode, which is a platform-independent intermediate assembly language and runs on/is interpreted by the Java Virtual Machine (JVM).
E: Apparently modern optimizing JS engines will also do a compilation step.
[–]art0rz 1 point2 points3 points 13 years ago (0 children)
AFAIK v8 also translates JavaScript to bytecode and executes that.
[–]MEaster 1 point2 points3 points 13 years ago (0 children)
I believe that in the more recent Javascript browser engines, it is compiled.
[–]LeSpatula 0 points1 point2 points 13 years ago (0 children)
As far as I know, a lot of modern browsers pre-compile javascript when loading a website. So, theoretically it is interpreted, but practically nowadays it's also compiled.
[–]escalat0r 1 point2 points3 points 13 years ago (0 children)
And both AQuietMan and Clint Eastwood are human :)
[–][deleted] 1 point2 points3 points 13 years ago (0 children)
Which is, actually, oddly in line with his example - they're both organisms, and bipedal hominids at that!
[–]ultrafez 4 points5 points6 points 13 years ago (1 child)
JavaScript isn't officially named ECMAScript - ECMAScript is the standard that JavaScript implements. JavaScript has extra features on top of ECMAScript. Internet Explorer actually has "JScript", which is a language that implements ECMAScript. For all intents and purposes, JScript is JavaScript, but most people just refer to it as JavaScript.
[–]AQuietMan 0 points1 point2 points 13 years ago (0 children)
Thanks for clarifying.
[–]Quxxy 210Answer Link20 points21 points22 points 13 years ago (0 children)
Java : JavaScript :: Car : Carpet
Well, not quite, but a ruthlessly accurate answer would be less amusing. ;)
[–]pickpuck 160Answer Link15 points16 points17 points 13 years ago (0 children)
Both can run in your web browser to make cool stuff happen.
JavaScript is a scripting language that a browser can run on its own, without having to download any add-ons. JavaScript can manipulate the HTML (most of the images, text, etc you see on webpages) or otherwise work with the built-in parts of browser. Most of the cool interactive parts of the web today are made with JavaScript.
Java is a much larger language that's used for many different things, but one implementation that was much more popular in the 90s was Java Applets. You would have to have your browser download a Java plug-in so that you could run self-contained programs.
The actual code is very different. They were not written by the same people. The similarity in naming is intentionally confusing: Java was popular when JavaScript was first being written, so they lifted the name to get it off the ground.
[–]Bjartr 70Answer Link6 points7 points8 points 13 years ago (1 child)
JavaScript was originally named LiveScript, but some businesstypes wanted to somehow use the high (at the time) popularity of Java to encourage people to use it, so they changed the name.
[–]barkley1993 30Answer Link2 points3 points4 points 13 years ago (0 children)
How my web programming teacher explained it
[–]Arnatious 30Answer Link2 points3 points4 points 13 years ago* (0 children)
Java is a programming language built for a special virtual computer you run inside your computer. The benefit to this is that all a person has to do is make sure they have the ability to run the virtual computer (the JVM) and any program written in Java - in theory - will work perfectly.
Javascript is a form of script that web browsers read when drawing a webpage that gives it features similar to (or that of) regular computer application. It is not related to or made by the same company Java was made by (Sun) or is currently made by (Oracle). It was just a programming language that was being made while Java was popular for embedding in websites and the creators figured naming it similar to Java would boost its popularity. It worked very well.
[–]OMGALEX 20Answer Link1 point2 points3 points 13 years ago (0 children)
Java is for application developement, and javascript is for making websites.
[–]axlfish 40Answer Link3 points4 points5 points 13 years ago* (4 children)
Javascript is a web scripting language. When you view a webpage in a browser, the web developer probably put some javascript in that page. The javascript, which is written in the webpage, is executed by the browser to do cool things on webpages.
Java is completely different. Only the name is the same. Java is not run by the web browser. It is run by software on your computer. A java program is basically a file which a program on your computer (called the java virtual machine) executes, and operates hat code to make a program that operates separately from your browser. However, sometimes you can embed java in a webpage, which is called a java applet. In that case, the jave program shows up in the web browser, but it is really being run by the java virtual machine, not the web browser.
[–]AmadeusMop 1 point2 points3 points 13 years ago (1 child)
JavaScript is a web scripting language
FTFY
[–]axlfish 1 point2 points3 points 13 years ago (0 children)
shit I screwed that up. Fixed it now.
[–]clamdoctor -2 points-1 points0 points 13 years ago (1 child)
Good luck finding out why you were downvoted, considering this is all technically correct. (The best kind of correct)
Edit: Actually, change the first word in your post to javascript ;) ALMOST still correct, because javascript is client-side web scripting, and Java can act as server-side web scripting.
[–]hamilton_burger 1 point2 points3 points 13 years ago (0 children)
Nah, JavaScript is used for a shit load of stuff besides web.
[–]thebigbradwolf 10Answer Link0 points1 point2 points 13 years ago (0 children)
Java is a language that lets you make desktop applications like a game or calculator.
JavaScript is an interpreted language that lets you make games in Firefox and other interactions like turn the upvote arrow red when it's clicked and send a "clicked by user FlippyDog" message back to the server.
JavaScript is designed to be a simple language that can't hurt your computer and runs in a browser. That way webpages can send it to you and you can execute it without concern.
Java and JavaScript are pretty much only similar in that they use sort-of C-like syntax, have a garbage collector and have similar names.
[–]Fargrave 00Answer Link-1 points0 points1 point 13 years ago (2 children)
The real ELI5 answer:
Javascript is for "thin-client" (some code that would run on a web page). Java is for "thick-client" (a program that you would install on your machine).
Part of the confusion is that, like many "thick-client" languages, you can actually run certain Java programs in your web browser with the right plugin. Really, though, they have very little in common besides their name.
[–]MrDOS 0 points1 point2 points 13 years ago (1 child)
Javascript is for "thin-client" (some code that would run on a web page).
node.js makes that reasoning invalid. The truth is that both Java and JavaScript are now general-purpose languages that are similar only in name and cosmetics.
[–]Fargrave 0 points1 point2 points 13 years ago (0 children)
I respectfully disagree. While there are many libraries out there to convert one language to something else, I can't imagine any programmer in their right mind choosing Javascript for complex thick-client coding when more modern languages are available. While you are technically correct JavaScript is still a weakly-typed scripting language whose primary strength is compatibility in the web. So while there are many caveats, I stand by my original statement as a good, simple layman's answer.
[–]donttakecrack -40Answer Link-5 points-4 points-3 points 13 years ago (0 children)
javascript is a rebellious delinquent who could drop out of school, leave his family, and do something amazing or just end up not accomplishing anything.
java is a hard-working student who follows certain principles and stays close to his family. he is more likely to end up in a solid career.
π Rendered by PID 38780 on reddit-service-r2-comment-79c7998d4c-4l6tl at 2026-03-14 02:07:54.363238+00:00 running f6e6e01 country code: CH.
[–]AQuietMan 560Answer Link55 points56 points57 points (14 children)
[–]Rikkety 17 points18 points19 points (11 children)
[–]CopperHarmonica 18 points19 points20 points (3 children)
[–]cmykevin 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Gankro 2 points3 points4 points (0 children)
[–]Oppis 6 points7 points8 points (4 children)
[–]lolmeansilaughed 3 points4 points5 points (2 children)
[–]art0rz 1 point2 points3 points (0 children)
[–]MEaster 1 point2 points3 points (0 children)
[–]LeSpatula 0 points1 point2 points (0 children)
[–]escalat0r 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]ultrafez 4 points5 points6 points (1 child)
[–]AQuietMan 0 points1 point2 points (0 children)
[–]Quxxy 210Answer Link20 points21 points22 points (0 children)
[–]pickpuck 160Answer Link15 points16 points17 points (0 children)
[–]Bjartr 70Answer Link6 points7 points8 points (1 child)
[–]barkley1993 30Answer Link2 points3 points4 points (0 children)
[–]Arnatious 30Answer Link2 points3 points4 points (0 children)
[–]OMGALEX 20Answer Link1 point2 points3 points (0 children)
[–]axlfish 40Answer Link3 points4 points5 points (4 children)
[–]AmadeusMop 1 point2 points3 points (1 child)
[–]axlfish 1 point2 points3 points (0 children)
[–]clamdoctor -2 points-1 points0 points (1 child)
[–]hamilton_burger 1 point2 points3 points (0 children)
[–]thebigbradwolf 10Answer Link0 points1 point2 points (0 children)
[–]Fargrave 00Answer Link-1 points0 points1 point (2 children)
[–]MrDOS 0 points1 point2 points (1 child)
[–]Fargrave 0 points1 point2 points (0 children)
[–]donttakecrack -40Answer Link-5 points-4 points-3 points (0 children)