8 ms·
Reasons to upgrade from Java 8
- wideareanetwork 6y agoStrange.... should the title be “You can’t afford NOT to run Java 8”?
- viraptor 6y agoNo, the author wants people to use versions higher than 8.
- ivanbakel 6y agoHow did you come to that conclusion? The point made is that Java 8 incurs costs compared to newer versions, so you need to "budget" for it. If you can't afford to not run it, then Java 8 would be saving you money/time somehow.
- wideareanetwork 6y agoBecause the first half of the article was praising Java 8 and it’s various benefits. I didnt read the second half because I couldnt make sense of the negative headline with the positive text.
- viraptor 6y ago> the first half of the article was praising Java 8 It wasn't though... not sure why you got that impression? (I do think though that the text could use a few edits for easier reading - maybe it just isn't easy to understand when skimming)
- fouric 6y agoThis is called "judging a book by its cover". Merely making assessments of an article after only reading a fraction of it (or the title!) is bad enough, but spreading those misunderstandings to other people is even worse - not only are you harming their understanding, but you're also misrepresenting the author's points. In addition, nowhere near "half" of the article is praising Java 8 - the very first paragraph says "This is one of the reasons why Java 8, almost 7 years after its first release, is still widely used.", which is barely "praise", and then the rest (>80%) recommends that you not use it.
- mrighele 6y agoThe article is about the improvements since Java 8. In other words the title should be read as "[Java 11/14/etc is so good that] you can't afford to run [i.e., stay on] Java 8" I agree that the title was a poor choice though.
- mikemybytes 6y agoThanks for the feedback! (author's here) I promise to be more careful when picking up the title next time. I hope that the article's content somehow compensated that ;)
- ant6n 6y agoI thought the same thing at first. But Apparently there are newer versions of java. For those who learn java in school and don't much touch it again, it can be quite confusing. It seems java was relatively stable from 2006 to 2016, where there where three versions. But instead of slowing down, there have been 8 since then. They`re on v16 now?! ...I doubt I`ll ever code in java again.
- pashky 6y agoDon't worry, all that's not getting widely used anyway. Cool startups don't touch Java anyway, and places like banks are still firmly at Java 8. My current employer is somewhat progressive, whole system is just a couple of years old, design is very much modern, microservices, event sourcing, reactive, cool reactive frontend on websockets, etc etc. Still Java 8 for the most part. Java 11 is actually allowed, but not many people care including me. Existing Scala code is getting thrown away and rewritten back into Java. JDK is different story tho. I think devops are actively experimenting to put 11 into base image by default, but startup time different is funny argument. 1 second, really? By the time your usual spring boot service comes up and connects to all topics and caches and what not it's good part of a minute anyway.
- jen20 6y ago> For those who learn java in school and don't much touch it again, it can be quite confusing. Is it really _confusing_? The idea that a product might change release cadence probably should not be confusing.
- ant6n 6y agoWell, the fact that all of the sudden there are all these new versions is surprising. That makes the title of the article confusing, because one doesnt expect that v8 is considered super obsolete.
- sudhirj 6y agoThe title paints Java 8 in a negative light, maybe change to "You can't afford to lag behind Java 8", or "You can't afford to not run Java 8+".
- whoisjohnkid 6y agoagreed; when I started reading this I thought they were saying if you are running anything below Java 8 it’s faster
- daitangio 6y agoUpgrading a Java 8 application is not easy if you have a very huge code base. The article focus on performance considerations, what about migration costs?
- dwohnitmok 6y agoI'm a bit curious because of Java's story around backwards compatibility: what exactly makes a huge code base difficult to upgrade? You can use all the same byte code and just run it in a newer JVM. The only concerns I can think of are dev ops related, not code related. Even there I'm struggling to think of big blockers (might have to remove some deprecated JVM flags). The only things I can think of are extremely precise tuning of JVM parameters for one particular use case and then needing to double-check that your performance hasn't degraded based on that tuning. EDIT: After seeing some responses I should clarify, especially because I wasn't all that clear in my initial question. The article is mainly talking about upgrading the JVM rather than upgrading your compiler. So just take all your class files and dump them into a new JVM rather than regenerating your class files from a new Java compiler. Has this caused substantial problems for people in the past?
- swsieber 6y agoThere was a lot of proprietary sun stuff that got yanked out in the 8 -> 11 shift, along with the addition of the module system that makes reflection to hack into dependencies a lot harder (IIUC). Upgrading 8 -> 11 is a lot harder than upgrading 11 -> 17 will be.
- mrighele 6y agoOne example that comes to my mind: libraries that handle bytecode manipulation (e.g. javassist) may require to be updated because they give new and strange error if they meet newly introduced bytecode. Since those libraries are often used by high level frameworks like Spring, this means that to move to a new Java version you have to update your framework. These most often means new API, new bugs, new regressions...
- cashewchoo 6y ago
- sudhirj 6y agoJust a quick shout-out to how far the language has come. Scala and Kotlin really lit a fire under Java's pants, and now the language is moving forward super-quick. Releases every 6 months, lambdas, fork-join, var, records, code looks and reads nicer, and the ecosystem is perking up too. Spring Boot, VertX, lots to look forward to.
- rattray 6y agoYeah, it's really disappointing to hear that the community isn't upgrading very quickly because the language is starting to look a lot nicer. I investigated creating a library for Java recently, and could have made a pretty decent API for Java 9+, but with so many people on Java 8 and below, it might not have been worth it.
- splix 6y agoI think one of the limiting factors is Android, which is still stuck with Java 8. So if you're developing a library, which in theory may be used in Android app by others, you have to stick to Java 8 to make it compatible.
- mikemybytes 6y agoI guess that's why Kotlin became so popular in the Android world - all the new & shiny features are present but you still can target older bytecode versions
- kimi 6y agoMeh.... "if it ain't broken, don't fix it." I (and I guess many other people, looking at JVM adoption numbers) do prefer a very stable and proven environment. I don't want to discover that "It would work/perform on 15 if only this and this was changed..." and re-test everything two times a year. So yes, I can afford to run what I know versus debugging all night to save one second of startup time. [Source] From last year's Snyk report: - 1 in 4 developers use the Java SE 11 in production - 2 in 3 developers use Java SE 8 in production - 50% of developers use OpenJDK distributions in production
- foobarian 6y agoOf all the improvements in later Javas, I find the standard library upgrades the most impactful; things like immutable collections, collection factory methods, better ergonomics for streams and optionals, etc. It doesn't really fall strictly under "syntactic" improvements like records or 'var'.
- jnwatson 6y agoI've recently been exposed to problem of upgrading Java, and I think a big reason why folks don't upgrade beyond Java 8 is because of the licensing mess. JREs are no longer distributed by Oracle. For client-side stuff, there's a linking tool called "jlink" that creates a minimal JRE for your app (and now you're responsible for keeping it up to date). Oracle wants a license to use their distribution. All that is a lot to catch up on. IMHO, the best approach is to avoid anything Oracle touches and stick to OpenJDK. For a lot of corporate environments, that's anathema though.
- gjsman-1000 6y agoIn that case why don’t they move to Amazon Corretto or other enterprise OpenJDK distributions?
- yjftsjthsd-h 6y ago> IMHO, the best approach is to avoid anything Oracle touches and stick to OpenJDK. For a lot of corporate environments, that's anathema though. I thought that was just the obvious path; why would companies not like it?
- offtop5 6y agoOpen Jdk tends to create random and strange issues. At that point you might as well pitch migrating the tech stack to .net
- yjftsjthsd-h 6y agoThat would be somewhat odd; isn't Oracle building off the openjdk as well? And I have trouble crediting the idea that moving to openjdk is anywhere near the effort to move to a completely different language+platform, even if there are differences.
- offtop5 6y agoTo be fair I haven't seriously touched java in about 4 years. I do remember Android studio explicitly warning users to avoid Open Jdk My second point was a joke, still I wouldn't be the one to rock the boat. If anything is even slightly off after switching to open JDK you'd need to justify it
- pentlander 6y agoI started upgrading some of the Docker images from Java 8 to Java 16 at work without touching the compiler. The changes I had to make to the code were fairly minimal, bump the version on a couple libraries and change the JVM flags on the Helm chart. The title is a bit clickbaity, but I agree with the premise for containerized workloads because the difference is huge. The faster startup is nice, but the biggest advantage is in the memory usage. G1 past Java 8 actually releases memory back to the OS instead of keeping it forever. In addition, I've seen applications use 1/7th of the heap space after upgrading. This translates to being able to significantly lower the memory limits for applications without worrying about OOMing. I haven't moved enough services to see the difference in CPU, but it looks promising there as well.
- whoisjohnkid 6y agoTitle should be changed to “You can’t afford to continue running Java 8”
- rutthenut 6y agoThat wouldn't necessarily be true though - some people could not afford to go through the work involved in upgrading from Java 8
- whoisjohnkid 6y agooh I agree for sure; the title is just a bit confusing as is
- mikemybytes 6y agoThanks for the feedback! (author's here) Sorry to hear that it could be confusing. I will look at its contents once more soon looking for some improvements.
- intsunny 6y agoI can't be the only person who read the title and thought: "oh no, what licensing quagmire has Oracle cooked up now?"
- rattray 6y agoThe title thesis here (which is that upgrading to the latest JVM from an older JVM will save a lot of money) isn't well-supported by the article, which doesn't really make claims stronger than "performance is somewhat better". There's no breakdown of how much better in terms of how much money you'd save based on the number of servers you're running. Conversely, there's no estimate of how much a migration from Java 8 to Java 15 or 16 would cost in developer time.
- mikemybytes 6y agoThanks for the feedback! (author's here) IMO the problem with calculating precise savings is there is no "standard" use-case that could be used as a reference. I took one real-life application as an example in order to be more precise than just "it's somewhat faster", but the benefits will differ based on many different things (platform, app size, frameworks, etc.).
- tyingq 6y agoThere's also the literal "can't afford" part. I assume there's a pretty high correlation of sites running Java 8 that are running Oracle's java. The license change they made in April 2019[1] means that you either need to get off of the Oracle provided java anyway, or start paying them. And, if you have to test/confirm that an OpenJDK release works, why move from Oracle Java 8 to OpenJDK Java 8? Go ahead and jump forward since you have to regression test anyway. It is higher effort, but you have the hood open already. [1] https://java.com/en/download/release_notice.jsp https://java.com/en/download/release_notice.jsp
- curt15 6y agoHow much longer is Google willing to carry the OpenJDK7/8 baggage for Android? At what point does it become more economical to finally upgrade to Java 11?
- cashewchoo 6y ago[I don't do Android, but, ] isn't Google trying to kinda pivot to Kotlin?
- pjmlp 6y agoYes, however Kotlin builds on top of Java and its FFI to Java libraries is a selling feature. It doesn't help much Koltin if those libraries can no longer be accessed with its FFI.
- bzzzt 6y agoGive them a moment, the judge just handed them the go-ahead to clone Java API's last week ;)
- pjmlp 6y agoThey were already using OpenJDK code snippets before that, it is really not wanting to.
- krnaveen14 6y agoI suppose many of us (including myself) are waiting for Java 17 LTS release so that there's is a single migration phase (8 -> 17) rather than doing it now (8 -> 11) and also (11 -> 17) after few months.
- swsieber 6y agoI'd say that Java 8 -> 11 is going to be and order of magnitude more disruptive than 11 -> 17. So if you have downtime now (ha ha), you might as well migrate to 11.
- chrisseaton 6y agoWhy not put all versions of Java, including the master branch build, into your CI, then you can instantly see what it's possible to upgrade to, and instantly see when incompatibilities appear. I don't really get what migration issues people experience in practice.
- tandr 6y agoupgrading from 8 to 11 is a good step to have. You will not believe how many problems pops up. Upgrading from 8 to 17 might be a very hard exercise - libraries and all..
- mosdl 6y agoAnother reason is that a lot of companies use Java 8 internally and it makes it easier to use your software if you support 8.
- patwolf 6y agoI long ago left the enterprise Java world. I imagine that despite modern cloud computing, there are still many companies running ancient Java application servers--servers that have been running dozens of applications for years uninterrupted, save the occasional critical security patch. The teams that developed those applications are probably long gone. Upgrading the Java runtime would probably require licensing and installing a new version of the app server. Only then could they consider rebuilding the apps for a newer Java runtime and running through months of regression testing. Such Java users certainly cannot afford to upgrade. However, I do think it's cool to see improvements in Java. Certainly Oracle can be blamed for some of Java's neglect, but I do think enterprise app servers played their part in limiting the potential of Java as a language.
- psanford 6y agoIts interesting to compare the general reluctance of the Java community to upgrading vs the Go community's preference to be on the latest version (or at most N-1). I suspect this is due to a number of reasons. Go doesn't have a separate runtime component so an upgrade is simply a recompile. I think Go's 1.x compatibility promise has also helped a lot with people feeling confident in upgrading. The Go team tries very hard not to break any existing programs with any of their changes through all 1.x releases. My take away from this is if you are building a platform, don't underestimate the value of stability across upgrades. If upgrades are painless your users won't mind upgrading. If upgrades are a big ordeal, your user will put off upgrading until there is no other possible option.
- adambatkin 6y agoI think there are two reasons why people haven't moved beyond Java 8: 1) There is nothing really compelling (despite what the article says, the performance improvements aren't that important for many real-world applications) 2) For this particular upgrade (anything beyond 8) the Java modularization introduces a pain for some libraries. I suspect that 9->10->11->...16 is totally painless, but 8->9 introduces a little bump.
- cesarb 6y agoThere's another important bump in 10->11 which removed all of the bundled J2EE, so you have to add external copies of the removed libraries (if they exist; for instance, IIRC the CORBA stuff was removed without an external alternative). In my experience, these external copies have small subtle differences to the former bundled copy, which can cause some issues; though the biggest issue IMO is to find the correct external library name and version for each bundled J2EE library you depended on (and sometimes even which J2EE libraries you depended on, some things are loaded through reflection so it only fails at runtime).
- psanford 6y agoPeople were really bad about upgrading off of Java 6. That was pretty terrible if you operated a TLS endpoint and wanted to drop old insecure configuration options. Sorry, you've got some ancient Java 6 clients that only supports DH 1024. And sadly the security issue is an externality to the owner of the client code. So unless you threaten to cut off their access they don't have much motivation to upgrade.