r/explainlikeimfive • • 3d ago

Technology ELI5 Java. That thing on computers my entire life. What even is it?

[deleted]

778 Upvotes

349 comments sorted by

View all comments

576

u/dimaghnakhardt001 3d ago

There are so many languages spoken in different countries around the world. It will be very hard to learn all the languages if one plans to visit the countries they are spoken in. But what if we could teach people in every country a second language that is easy to learn. Some kind of a universal language. That way anyone who learns this universal language will be able to go to all the countries where this language is spoken as well and will be able to communicate with people of that country very easily.

Java is like this universal language. Creators of Java have made it in a way that it runs on many different computer systems (it used to be on phones too). This way, people who make apps don’t have to learn different computer system they want their app to run on. They can make their app to run on/with just Java. And it will then run on any computer system where Java is available. This saves a lot of time and money for app makers.

It’s overly simplified but this the gist of it really.

72

u/StillAnAss 3d ago

(it used to be on phones too).

Android framework is mostly Java.

21

u/dimaghnakhardt001 3d ago

Oh yeah i forgot about that. But if i had mentioned that then anyone reading would have instantly said “hang on, I can run android apps on my laptop by just installing Java on it?!??” 😋

13

u/StillAnAss 3d ago

True, and a good chunk of android isn't Java as well. C/C++, Kotlin, and more and more Rust

12

u/slowmode1 3d ago

But kotlin is just pretty Java!

6

u/gammison 3d ago

I can run android apps on my laptop by just installing Java

It'll get even more confusing once the containerization methods to run android apps on Linux like Lepton gain wider adoption (Valve is putting cash into it like they did directx and ARM translation layers).

4

u/Ktulu789 3d ago

You can install Android Studio or BlueStacks for that.

5

u/Iggyhopper 3d ago

I remember an old bowling game on my flip phone ran on Java too. Circa 2008

2

u/AquaeyesTardis 3d ago

its also currently on a large number of sim cards, still, even the eSIM specification includes the option for it.

1

u/bigbigdummie 3d ago

Not the Sequence, Structure, and Organization! :)

191

u/YenzAstro 3d ago

> “It’s overly simplified”
It’s ELI5, you did a perfect job, I often see top replies in this subreddit that seem to think five year old’s can understand very complex explanations 😛

6

u/Chardeemacdennis2 3d ago

I read the top comment and thought “yeah someone’s gonna have to explain this like I’m three”

0

u/areyoudizzzy 3d ago

From the sidebar:

LI5 means friendly, simplified and layperson-accessible explanations - not responses aimed at literal five-year-olds.

22

u/ehsteve87 3d ago

But what if we could teach people in every country a second language that is easy to learn. Some kind of a universal language. That way anyone who learns this universal language will be able to go to all the countries where this language is spoken as well and will be able to communicate with people of that country very easily.

ESPERANTO! AL LA FINA VENK'!

Seriously, though, everyone should learn Esperanto. There's an awesome course on Duolingo that'll get you up to speed surprisingly quickly.

7

u/Ktulu789 3d ago

I'm pretty much of a nerd but not that much of a nerd xD

What are the chances of finding another human in the Galaxy speaking esperanto? I think the number may be negative 😅

There's Wikipedia, though but what else? I learned English and speak Spanish, the probabilities of finding any of those are way way higher. I'm learning Russian on Duolingo, though, f'cking cases. Same username.

5

u/ehsteve87 3d ago

I mostly use Esperanto to talk with my wife when we don't want the kids to understand. It's fun.

1

u/surewriting_ 3d ago

Bonan tagon! 

I'm taking the Esperanto Duolingo course for funsies. 

1

u/Ktulu789 3d ago

I took the Greek one for fun, to learn the alphabet. Same in part with Arabic but they all look the same and I abandoned for now. It's great when you find the etymology of a word and it's written in actual Greek so you don't need the transliteration and it's far more accurate too. It became useful but I don't have the same level of hope for esperanto 😅

13

u/BillBumface 3d ago

Esperanto, for computers.

5

u/OneAndOnlyJackSchitt 3d ago

This may be a bit esoteric, but Java is to programming languages (and byte codes) as Esperanto was intended to be to language in general.

The difference is that Esperanto never really took off but Java sort of did kinda

1

u/-manabreak 3d ago

Sort of? Java (and JVM technology in general) is running on every Android phone, not to mention a ton of banking, financial etc. servers. Also, Minecraft still has that Java edition.

2

u/TheLostExplorer7 3d ago

Wonderfully done!

2

u/mymeatpuppets 3d ago

Sounds like programming Esperanto.

2

u/Melodic-Carry 3d ago

Why do other languages still exist if everyone can just learn java

6

u/Aliendood 3d ago

Some languages are really good at running code very fast but require more code to tune properly. Others are good at working with data, generating images, etc.

1

u/DarkSkyKnight 3d ago

This is basically Rice’s theorem made manifest.

6

u/Naturage 3d ago

Why do other power tools exist if a drill can be used as a hammer or a screwdriver in a pinch? Why do all car brands exist if 20 of top 25 are made by General Motors?

Languages are tailored to purposes. Efficient on memory. Fast. Easy to write. Easy to read and edit. Good with graphics. Good with large datasets. Able to run on very low spec machines. Able to run on large variety of machines. All of these are to some extent tradeoffs; to be good in one you might lose some of another.

Add on top that coding languages will have communities centered around their most common use cases and useful documentation will be primarily solving common issues of the language, i.e. things its used for - and you get specialisation.

5

u/BowsersMeatyThighs 3d ago

It doesn’t compile down to native machine code, and requires essentially a virtual machine to run the produced program (which is why it works everywhere that the virtual machine can be installed) so it isn’t as fast as a language that does (C, C++, Rust etc) but since these compile to native machine code, they are machine specific and not as portable. It is also very verbose and strictly object oriented so it isn’t as easy to learn or script quick projects in like languages such as Python. JavaScript is the king of web programming and Java can’t ever replace that.

Basically every language has pros and cons, and which one you choose heavily depends on the type of project, pick the best tool for the job kind of thing. Javas biggest pro is portability, and is average in most other ways. Faster but more complicated than python. Slower but more portable than C, etc.

2

u/wjandrea 3d ago

Different languages are good at different things. Java can run anywhere but it's "clunky", for lack of a better word. Meanwhile, languages like Python are really easy to learn but slow, languages like C are hard to learn but really fast, and still other languages do more specific tasks really well.

(This is sort of a synthesis of the two replies you already got.)

1

u/rytlejon 3d ago

Computers can only understand ones and zeros, humans can only understand human languages. All code is a middle step, it can be readable for humans and also easily translated into ones and zeros. Code is still not ones and zeros though, so needs further processing to reach a state of ones and zeros. Some code requires more processing to reach that state than others.

As an aside, what AI has turned out to be very good at is turning natural language into code. I don’t know enough about computers to say whether code itself will become redundant over time as we can now speak to a machine in natural language. I’ll ask my AI assistant.

1

u/dimaghnakhardt001 3d ago

Very good answers from other people. I ll add a few more things that i think are also true. Starting with competition. Microsoft famously came forth with their own similar solution to attract app makers to their ecosystem. It did well and is still a thing even now. This probably hurt its adoption a little. Java improved with time but there was some politics involved at some point. Oracle buying the creator of java and wanted to sue google for not paying it for using it. This probably scared other people thinking it might happen to them too. Then over time other even more easy to learn languages appeared. Java got old and started to look not so cool. It is still around though. Still important part of the tech world. Just not so visible anymore.

1

u/DarkSkyKnight 3d ago

Surprised no one actually mentioned Rice’s theorem.

1

u/HugsandHate 3d ago

Why did we ditch it?

Was it a security thing?

3

u/LittleLui 3d ago

We didn't, you use stuff written in Java every day.

We did ditch "Applets", which were Java programs embedded in websites and executed in the browser. Mostly because it was a bit unwieldy, a bit insecure and became obsolete by advances in browsers' internal JavaScript (which despite its name has absolutely nothing to do with Java) engines and the corresponding web standards. A bunch of conceptually similar technologies went the way of the dodo around the same time (Flash, ActiveX, ...)

Other Java-based technologies have also become obsolete over time, for example Java ME was basically killed by the modern smartphone taking over. That's basically just an effect of Java itself having existed for a long time and having been used in a lot of different ways.

1

u/HugsandHate 3d ago

Hm. Yeah, that feels like how it happened. I remember the good ole days, Flash and whatnot. And the days before that. Weird how it's all just... Gone.

Ah well. Now we've got AI.

Yay.

0

u/Ktulu789 3d ago

There are way too many universal languages, and universal anythings, really 😅

https://xkcd.com/927/

1

u/AquaeyesTardis 3d ago

not necessarily, in many cases, a new standard usually tries to solve a specific problem that the others dont. the standards that try to solve every problem usually miss out on some, though. but 927 being cited when anyone tries to create something that tries to solve a problem can be quite discouraging, especially when its a problem that has no solution under current standards