9 ms·
As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently
by tmp7oaje 6y ago
As a student most of the way through a Java course, I'm wondering what Java is still used for. Java applets are dead, Android is moving on to Kotlin (apparently Google got in legal trouble with Oracle even though Java is "open source?"), and I can't think of any desktop applications that use Java anymore. Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run.
Yet clearly I'm mistaken, since Java is still one of the most popular languages.
Edit: also please help me understand - do I have to pay for a license even though Java is open source? Is this normal for other languages too?
- sparsely 6y agoJava is used all over the place for various backend applications, e.g. data processing, web backends. It's fast, well documented and has a great standard library and ecosystem. In many of these applications you control the deployment environment, so making sure that your container has the JVM isn't an issue.
- azatris 6y agoWe use it on servicing the backend of an e-commerce website. The code is now 2 decades old and wonderfully refactorable to modern code.
- enw 6y agoI’m assuming Amazon? Most of Amazon runs on Java.
- dehrmann 6y ago> still It's a very popular backend language. Ironically, "run anywhere" isn't much of a requirement for backend development. > C++ is more portable because it doesn't require the JVM to run. For backend development, this isn't much of an issue either way. These days, the main advantages C++ has to Java is startup time and no GC pauses. It's also not as portable as you'd think. Take a look at cross-platform C/C++ projects and you'll see a lot of special cases for particular platforms. Java's popularity mostly boils down to it's mature, has a large ecosystem, and is adequate for a lot of things. Unless you're writing an iPhone app or system-level code, it's unlikely to be a bad choice.
- vbezhenar 6y ago> Ironically, "run anywhere" isn't much of a requirement for backend development. If you’re using Java, you can develop on macOS, deploy on Windows Server, then switch to Linux on AWS Graviton and M1 Macbook. Without a singe recompilation.
- watwut 6y agoThere are no GC pauses issues practically now and for years. Language startup is also not all that much issue.
- dehrmann 6y agoI'd say they're at a point where they're not a problem for most use cases, but if you're trying to get p9999 latency down, you might have to start looking at them.
- kaba0 6y agoThe default GC has ridiculously good throughput with modest latency (10ms for quite large heap sizes), but there are also alternatives like ZGC and Shenandoah that optimize for latency instead, and they promise <10 ms latency, but in practice they are around 3-4 ms. At which point, not running a real time OS, you will get bigger hiccups from the OS scheduler. Also, for very different use cases like soft real time, there are specific JVMs with real time guarantees. Here is a great post about it: https://jet-start.sh/blog/2020/06/09/jdk-gc-benchmarks-part1 https://jet-start.sh/blog/2020/06/09/jdk-gc-benchmarks-part1
- haglin 6y agoAnd in JDK 16, ZGC has concurrent thread-stack processing, which typically reduces GC pauses below 1 ms https://openjdk.java.net/jeps/376 https://openjdk.java.net/jeps/376 https://youtu.be/88E86quLmQA?t=1525 https://youtu.be/88E86quLmQA?t=1525
- ssijak 6y agoWith graal vm java apps compiled to native have amost 0 startup time
- xwolfi 6y agoI work on the trading floor of an investment bank in Hong Kong. Our OMS is made entirely in low latency Java (no GC, lots of perf test, few C++ binding when really we must). Java allows us, contrary to our poor colleagues in algo still on C++ to work in team, manage dependency, use really good tooling, unit test easily, have libraries that work consistently all across the universe (that's a beef I have with Python: every library seems to work differently with different casing and principles so I have to read enormous doc all the time bleh). It compiles fast enough, every monkey joining has done enough Java at university to get started, and it prunes all the autists who love complex one-liners and attract people more into team work and well-organized simple stuff. As for profiling, I still have to meet a C++ colleague with a good efficient profiler in my company, while us monkeys in Java (C# is great too tbh) can just run a graphical profiler, click on 3 buttons, and find what's not optimal. Java isn't a language for the elite. And while the elite crashes the system and lose millions in 30 minutes, us dumbasses in Java can build and release with good tools without using bin patches that remove critical features :) You'll see when you start working. Every company is a shitshow, better be in a Java shitshow with slow idiots than in a C++ shitshow with autist geniuses :D You don't have to pay a license, but it's starting to get blurry. My giant company is phasing out Oracle's JVM and moving to OpenJDK, so there's that...
- victor106 6y ago> Our OMS is made entirely in low latency Java (no GC, lots of perf test, few C++ binding when really we must) Any resources on how to do this?
- eganist 6y ago> better be in a Java shitshow with slow idiots than in a C++ shitshow with autist geniuses :D Please don't use Autism as an insult. It's exceptionally degrading to conversation here and presents no value; it does nothing other than cast you in a negative light. I'll ~delete~ edit my comment if you edit the remark out, provided you do so before my ~delete~ edit threshold expires. Edit: delete threshold expired. Can only edit, and won't be able to edit once the edit threshold expires.
- 6y ago
- fh973 6y agoHere at Quobyte, we're developing a distributed file system that is partially written in Java. The JVM is rock-stable, fast, and developers are very productive in Java.
- austincheney 6y agoI discovered Quobyte today thanks to this comment. I am extremely excited to start exploring your technology. I am also working on a networked file system solution. My approach is likely fundamentally different. Instead of a single file system to represent file system artifacts across various devices I am using a single simplified data model as an abstraction for all file systems and pairing that with a new security/identity scheme. The idea is to solving for file asset distribution using point-to-point solutions that don't compromise security or privacy. https://github.com/prettydiff/share-file-systems https://github.com/prettydiff/share-file-systems I suspect your approach is likely far more stable as I am still working out the kinks in my models, but I supply a complete GUI in the browser that works the same in all browsers on all modern OSs.
- drdrey 6y agoLook into Spring Boot for cloud applications, it’s a big ecosystem
- cesarb 6y ago> and I can't think of any desktop applications that use Java anymore. The desktop application everyone has to use to report the income tax in my country is written in Java. Which is nice since it runs anywhere that has a recent enough JRE; in a distant past, before it was rewritten in Java, it was first a DOS-only and then a Windows-only desktop application.
- stevehiehn 6y agoAll jetbrains IDEs are JAVA. Webstorm, Intellij etc
- krzyk 6y agoE. g. Backend services for webapps or HFT.
- shp0ngle 6y agoJava is used a LOT on the back-end still. Yes, golang is shiny new thing, but there is TONS of boring back-end done in Java. Whole Alibaba runs on Java, for example. I know of some companies (won't share names but fill in the blanks) that used to be Go shops, that were eaten by Alibaba and they migrated from Go to Java.
- Maphistow 6y agoWouldn't agree on the GO statement, yes GO is great in terms of performance but it still lacks some important language features AFAIK no generics, no proper exception handling. I honestly don't know how the GO ecosystem is, but I can't imagine it's as mature as java. Perhaps I'm wrong tho
- shp0ngle 6y agoI’ve removed that part of the post as I don’t want to make this about go :)
- geodel 6y ago> no proper exception handling. That's just like saying Go does not have application servers, DI, IOC, ORM frameworks, runtime reflection and so on. Different languages have different ways of achieving user requirements. It is not one-to-one matching. > ... I can't imagine it's as mature as java. Yes, depending on perspective, not as mature or not as fossilized as Java.
- noisy_boy 6y agoJava is _very_ prevalent in Financial IT - almost everywhere. C++ is probably the only language in the same league in terms of usage. I have also seen C# lately in bunch of places but mostly middle-office/back-office.
- hdctambien 6y ago> C++ is more portable because it doesn't require the JVM to run Java is portable BECAUSE of the JVM. If a new computer architecture hits the scene, once someone writes a JVM for it your .class files will run on it (probably). Your C++ program, however, will definitely not run and you'll need to recompile it with a compiler that targets that new architecture. The same compiled Java code will(should) run on a Mac or a PC or any Linux box, but you need a different executable for each target with a C++ program. The JVM isn't portable. That needs to be recompiled for each new target, but your Java .class files are portable.
- AlotOfReading 6y agoFor a couple decades, x86 was absolutely dominant and there were no new architectures of any importance outside specific niches. Once you dealt with the OS specific oddities (which java also helped with), C++ was highly portable.
- jacques_chester 6y ago> For a couple decades, x86 was absolutely dominant On the desktop and servers, maybe. But there is more in heaven and embedded than is dreamt of in your philosophy.
- AlotOfReading 6y agoI work in embedded. Embedded Java has always been a huge set of tradeoffs, which is why it never took off outside of application platforms like mobile phones and set-top boxes. If you wanted the full fat SE Sun/Oracle JVM you were pretty much stuck with power or ARM, and even then you had to be careful. Remember the portability disaster that was symbian and Java ME? These ISAs weren't exactly the low end of the embedded market at the time either. The farther away from x86 you got the less portability you could actually take advantage of.
- kllrnohj 6y ago> Remember the portability disaster that was symbian and Java ME? Don't forget Java Card in that list. Which Oracle still tries to claim as a Java portability win, even though it doesn't support basically anything. And I don't mean missing standard libraries, I mean like it doesn't support char, double, float, and long, or multidimensional arrays. Support for int is even optional. Doesn't support exceptions and you can't even assume it has a garbage collector. Among many other limitations.
- coldtea 6y ago>As a student most of the way through a Java course, I'm wondering what Java is still used for. A huge majority of all code behind services, websites, and businesses you interact with every day. From Google, Facebook, Apple, and Twitter to your bank, and from Android to you favorite new unicorn. Of the top 25 unicorns "20 use Python; 19 use Java; eight use Kotlin. Coinbase was the only top-ten unicorn found to use Swift." [1] And that's just startups and FAANG. On top of that, every enterprise, government organization, and financial organization also uses tons of Java with the exception of Microsoft shops, which use C# in its place (or also use C# on top of Java). Think of it this way: you know how C# is a big industry? It's #5 in the TIOBE index. Java is #2, and has been between bouncing between #1, #2, and #3 spots for decades. And on top of Java there's the JVM, which also powers Kotlin, Clojure, Scala, Groovy, and other languages... >Java applets are dead Java applets have been dead on arrival. It was just a fan around 1997-1999 and not that succesful even then (I was there). They were never a big part of Java's allure. >Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run. That's a non-sequitur. [1] https://insights.dice.com/2019/07/12/python-java-kotlin-skills-unicorn/ https://insights.dice.com/2019/07/12/python-java-kotlin-skil...
- Aardwolf 6y ago> Java applets have been dead on arrival The only successful Java applet I know was Runescape (if that was an applet? it ran in browser), an RPG game that ran in Java in the browser, for 15 years or so roughly afaik, today they switched to a non browser based client instead. Other Java applets almost never worked for some reason. Like, sometimes I'd visit a website about some mathematical topic, and the whole browser would hang while some java applet demonstrating the math was supposedly loading, and then most of the time it didn't actually work.
- foobarian 6y agoThe only applet I know of outside the early few years of hype that still works and does something useful is Falstad's circuit simulator. https://www.falstad.com/circuit/ https://www.falstad.com/circuit/
- lilactown 6y agoOther languages have started to eat into Java's market share, but coincidentally a lot of them run on the same host VM as Java. For instance, Kotlin, Scala and Clojure are more and more frequently seen in backend, web and mobile development. These languages are definitely much more "portable" depending on what your definition of portability is; the JRE runs on A LOT of systems and abstracts much of the underlying system away for you, meaning that IME you have to write a lot less platform-specific code if you're targeting e.g. Windows, macOS and Linux. As for your edit, the licensing is a bit complex for Java but TL;DR if you install OpenJDK releases you do not need to worry yourself about licensing.
- Bumkatio 6y agoI have worked with Java EE (Enterprise Edition) for a few years. Java in the backend is probably the most common one when doing enterprise software. Lets define it differently: Everything what is not an SAP System and is backend and is not Cobolt, is Java at least for automotive and banking. Automotive -> managing cars, service contracts, financing offers, accessories and for banking -> money management, insurance, contract management etc. You go to a shop and you wanna finance something? Might be a Java backend or Cobolt :D) Spring/Spring Boot as a Framework got a lot of traction because Java specification process was just way slower and more boilerplate And yes Oracle got fed up of doing Java for free for too long and if you wanna use an older version of java and still need patches, you will need to pay. Luckily there is were java actually shows it strength which i have not seen in other languages: You define a specification, you get a reference implementation from someone and then everyone around it starts to build on those specifications. This allows for different jpa (database access with java) implementations, different application server etc. It also allows for different companies to do their own JVM implementation/maintenance track/version. From an ecosystem pserpective, the JVM itself (without java) also did a great job and shows how versatile it is. Close to what .net is doing but in a more free version. And you could throw .net/c# into the same similiar category as Java. Language feels similiar and if you are a MS company, you just use C# perhaps. But switching between c# and java is much easier than to other languages. From all languages i know and worked with, i do like JVM based languages the most. golang is interesting but nothing i would wanna use for a big code base at all. C/C++ i would use if i need to because of tooling features, how you write it and how hard it is to write it good; Java is fast, java has great tools for a long long time: Great Debugging features, great memory and performance analysis and tools, lots and lots of frameworks and architecture catalog. PHP is written and used in business context like java but without the benefits of running on the JVM. I don't recommend it. Its not bad, its less boiler plate but its just not a nice well defined well designed language. Most shocking to me was the performance optimizations which were done a few years ago which shows how little interest in that language exists that you can just optimize it that much. What facebook did with PHP was just shitty and weird.
- overtomanu 6y agofor a while i got confused and thought you were talking about usage of cobalt element in manufacturing of automobiles.
- deleted 6y ago[deleted]
- fma 6y agoI'll give you a bit of advice I give to engineers I mentor. Go to a tech jobs site like dice.com, and put in a technology you're curious about. So, put in java for your zip code. See what jobs are available. Are they back end? desktop? Then you'll find out where java (and any other tech) is used, and how popular it is. For example, how many jobs are there for PHP compared to Java? I'm not saying you should adapt a technology based solely on the number of jobs...but we all gotta eat. And on the flip side if you see Java jobs decline over the years...time to learn the one that's increasing :)
- hota_mazi 6y agoExcept for "Java applets are dead", everything else you wrote is wrong :-) Android is not moving to Kotlin: Kotlin is simply supported as a first class language in Android. Most of Android itself is written in Java and while it's clear that an increasing number of Android developers are switching to Kotlin, Java will never stop being supported on Android. The legal battle between Google and Oracle has nothing to with Google using Java. You can use Java for free and without any licensing concerns (use Open JDK). C++ is less portable than Java precisely because Java runs on a JVM.
- vbezhenar 6y ago> do I have to pay for a license even though Java is open source? Most people use free OpenJDK builds (Adopt OpenJDK, Zulu OpenJDK, Oracle OpenJDK to name a few). There are some builds which require license, like Oracle Java. If you need some kind of advanced support, you have that option.
- ksec 6y agoVast majority ( if not All ) of Fortune Global 2000 use Java as their Main Programming Language for their BackEnd. And this isn't changing anytime soon. Their initial investment, continue investment and Java Ecosystem itself are still marching forward. I dont see any language ecosystem that could match or challenge Java any time soon. Remember you only see Java Haters on HN and Reddit. In the Real World it is all about Business Values Delivered and Get Shit Done. JVM in itself is a monster with State of the Art GC and JIT. All of the above means there is a positive feedback loop into making Java better. And there are things that were in the work for 10 years ( Like GraalVM ) before hitting mainstream. And many more to come.
- tarkin2 6y agoJava is rarely used for sexy stuff like front-ends or (increasingly) apps. Java is, however, used for services. Bank logins, search engines (Google originally used it), insurance systems. C#, C++ and Rust are in the same area. But Java, for the most case, has been around longer. A LOT of companies used it and can't easily switch their codebase to something newer and shinier. And now Java improves with every release they have fewer reasons to move.
- thesimon 6y ago> A LOT of companies used it and can't easily switch their codebase to something newer and shinier I don't agree with that. Spring Boot makes it so easy to write nice backends and a type system is often useful > they have fewer reasons to move Move to what btw? NodeJS?
- MeinBlutIstBlau 6y agoLiterally every business that adopted it back in the 90s. Like all of insurance.
- therealdrag0 6y agoTo give you some more details of how Java can be used in the backend, while there's obviously unknown "generic business logic" there's also big name infrastructure pieces you can look up: - https://en.wikipedia.org/wiki/Apache_Hadoop https://en.wikipedia.org/wiki/Apache_Hadoop - https://en.wikipedia.org/wiki/Apache_Kafka https://en.wikipedia.org/wiki/Apache_Kafka - https://en.wikipedia.org/wiki/Apache_Cassandra https://en.wikipedia.org/wiki/Apache_Cassandra - https://en.wikipedia.org/wiki/Apache_Lucene https://en.wikipedia.org/wiki/Apache_Lucene - https://en.wikipedia.org/wiki/Elasticsearch https://en.wikipedia.org/wiki/Elasticsearch - https://en.wikipedia.org/wiki/Apache_ZooKeeper https://en.wikipedia.org/wiki/Apache_ZooKeeper - https://en.wikipedia.org/wiki/Apache_ActiveMQ https://en.wikipedia.org/wiki/Apache_ActiveMQ
- dpatriarche 6y agoJava is not commonly used for consumer desktop applications, where it often is necessary/desirable to invest in fully native apps for Windows and MacOS. But desktop Java is quite common in business desktop applications, for example, medical devices (like radiology image viewers).
- nomercy400 6y agoMost OpenJDK implementations do not require a license. There are multiple implementations of the Java VM. Java is designed by a collaboration of companies and OpenJDK is the reference implementation. Based on the license of the company, its implementation is free or not. Now, Oracle was the biggest and most well known contributor of OpenJDK for a long time (and probably still is). And Oracle did something unusual, which is that they made their own version no longer free. Which is why you are confused. You can still get Java from Oracle, with Long Term Support, but now it is paid support. The OpenJDK reference implementation is still free, and many companies have made their own tweaks and provide Long Term Support for these versions, mostly because they use tons of Java and/or want others to keep using Java because of its massive ecosystem, for which they can provide consulting/paid support. Note, you can still run these versions commercially, but if you want support you likely have to pay. The Google issue was that before all this OpenJDK stuff, all designing of Java was done by a single company, Sun, which was bought by Oracle. So a single company designed, developed, implemented, maintained, and built up the ecosystem of Java. This includes years of R&D in what keywords to use, and how classes work, basically the rules of the language. Tons of developers got into Java. And they attracted big customers like banks and governments to pay them for this R&D with support and development. Then came Google and they said, we like this language design and ecosystem and developer skills, but we don't want to pay for that support, so thanks for all the hard designing of your language, but we will create our own implementation and pay you nothing. Basically Google didn't want to pay it's share of the Java R&D. Now things get a bit blurry because of Oracle, which bought Sun, and tried to make a lot more money off Java while reducing R&D spending. So Oracle isn't too popular either. Things have improved since Oracle decided that Java isn't something to make a lot of money off, and the whole Google debacle. Now Oracle is mostly stewarding the language and other companies are now also contributing features. The past few years there have been some good and strong updates to Java, making it feel more like a leading language than a trailing language. Basically, get AdoptOpenJDK, latest version if possible, and don't use preview features.
- kag0 6y agoYour credit card runs Java, that's a fun one
- kamaal 6y ago>>I'm wondering what Java is still used for. A good part of AWS is written in Java. The Hadoop, Storm, Spark, Kafka etc major backend projects are written in Java. In fact if you are writing anything even half serious. Java is what you chose to write it in. >>Java is supposed to be able to "run anywhere," yet C++ is more portable because it doesn't require the JVM to run. Manual garbage collection is long dead, and it won't be revived any time soon. Machines have gotten too fast and resourceful for most of the developer community to give it a serious selection choice for their projects. Not saying C++ or Rust is dead. They have their place. But they are not going to be used for bulk of everyday projects. That ship sailed long back.
- sproketboy 6y ago"As a student" As a MS paid shill. FTFY