2

I have many legacy java 6 projects and I need to add it some updates. Unfortunately I'm afraid many of us don't have the liberty to ask our customers to upgrade their JDK's. So my questions are as follows:

  1. Is there a way to use java 8 features such as Backports ?
  2. Is it really efficient solution to use it in production ?
  3. What is there impact in the performance of application ?
hoss
  • 113
  • 5
  • 6
    I'd start to make myself familiar with 1) [retrolambda](https://github.com/orfjackal/retrolambda) for lambdas and method references, 2) [streamsupport](https://sourceforge.net/projects/streamsupport/) for a backport of the Java 8 Stream API and 3) [ThreeTen](http://www.threeten.org/) for a backport of the Java 8 Date & Time if you have a need for that. – Sartorius Feb 07 '18 at 20:27
  • 3
    All of the tools / libraries that @sartorius mentioned are widely used in Android development, so that should answer your first (and, probably/partly also the second) question. As for runtime performance, I can say that at least retrolambda doesn't introduce any overhead. – Anlon Burke Feb 07 '18 at 20:42
  • 1
    Another thing: if you are reluctant to introduce a bytecode translator like retrolambda in your build & debug process, you can always use these libraries in the old-fashioned way using anonymous classes instead of lambdas or method references (as you could in Java 8). Of course, that introduces a lot of nasty boilerplate code but it is perhaps a better way to start unless you're already comfortable with the syntax. – Anlon Burke Feb 07 '18 at 21:11
  • 2
    Java 6 reached its end of life eleven years ago. I suggest looking up which commonly use software from that time, applications and even operating systems, is still supported (in the major version of that time). So, those customers, you are afraid of asking to upgrade their JDKs, most likely have updated every software on their computer, perhaps even replaced that more than a decade old computer, but not the JDK. That’s creepy. I can only recommend every software vendor to include a passage into the contracts that denies support for any 3rd party product that isn’t supported by its own vendor. – Holger Feb 08 '18 at 13:11
  • 2
    @Holger I do not want to be mean, but I currently sometimes fix issues for a project that is in java-6, this is a humongous company, billions of dollars worth and they have not upgraded. I do understand the point, but I have zero power in telling them that they must upgrade... the OP might be in the same shoes – Eugene Feb 08 '18 at 13:49
  • 1
    @Eugene I understand very well, that often developers are not in the position to say that. And even those people in the right position aren’t able anymore, because they should have taken care when signing the contracts about the support. Still, it’s an insane situation, as all parties are wasting money. Considering typical support costs, your company probably could save money by giving the customer a new computer with preinstalled Java 9 as a gift. Or, in more practical terms, hide the new JDK in a library deployed with the update of your software, pretending to still run under Java 6… – Holger Feb 08 '18 at 13:57
  • @Holger Not arguing with your main point, but AFAIK Java 6 EOL was in November 2012 and premier support ended 2015, extended support is available till the end of 2018. – Anlon Burke Feb 08 '18 at 14:01
  • @AnlonBurke indeed, mixed up “software from” (release) with “end of life”. It was released, when we had WindowsXP, resp. Windows Server 2003… – Holger Feb 08 '18 at 14:07

0 Answers0