Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Java SE 9 for the Impatient: About migration to Java 9

 
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome Cay Horstmann,

My questions,
From the technology perspective, do you recommend to migrate from older versions of Java (4 - 7) to Java 9? Why?
Does any upgrade in Java 9 breaks anything in my Java 5/6 code, aside from deprecation? I read that in the roadmap was listed the removal of some behind-the-scenes stuff and some APIs got deprecated.

Thanks.
 
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope you are no longer using Java1.4 You are missing out severely by not using the functional‑like features of Java8/9; remember that Java8 is nearly four years old now. and even Java7 is no longer being supported. You can compile code to work on older versions; I can get back as far as Java1.4 from Java8 but the Java9 version of javac won't accept source or target options older than Java6.

As far as I know, backward compatibility is being preserved. Your old code should work on all newer versions. There is more discussion about deprecated code here. Yes, Oracle have been pretty ruthless in marking code as deprecated.
 
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Being stick to really obsolete java version is a problem. Anyway, I wonder if the adoption of a really fast update pace will be an advantage for Java. We're passing from a situation where Java changed really slowly, to a scenario where Java 9 isn't widely adopted yet and I already hear about Java 10...
 
Campbell Ritchie
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought they were changing the version numbers and 18.3 would come out next month.
 
Rancher
Posts: 1041
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even 1.5 brought many changes most notably generics.

By the way I once witnessed that a given version of Oracle IAS application server (originally ment for 1.4) did not run with 1.5 when we wanted to upgrade. But 1.6 was already out there so it became the solution.

Depending on your needs you might double check beforehand.
 
author
Posts: 284
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Java 9 is the first version of Java that breaks a lot of things. To see that, just start up IntelliJ from the command line and see dire warnings fly by. Or run sbt and see fatal errors. I can name a dozen other programs that had issues, and I have a Bash alias to switch between Java 8 and 9 on my development machine.

And no, I do not recommend that you upgrade all your products to Java 9 because there will be Java 10 and 11 before you are done.

Java 11 (the Fall 2018 release) is supposed to be a long-term support release. That seems the most reasonable target. Developers should of course test with the latest and greatest (9, 10, and starting in the summer, the 11 pre-release). Mop up your Java 9 issues now, because at some point, those warnings will turn into errors.

Cheers,

Cay

 
Jorge Ruiz-Aquino
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not using Java 1.4, at least not for new projects. However there are plenty of legacy systems out there that were migrated from Java 1.4 to Java 5 or 6. But the code of those systems remains the same, they just migrated the runtime but not the code itself. (thank you backward compatibility )
So, for those kind of systems, it worth to migrate to the new runtime?

I think refactoring the old code to use the new advantages in Java 8-9 (which I prefer) is a business feasibility discussion.  
 
Jorge Ruiz-Aquino
Ranch Hand
Posts: 99
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cay Horstmann wrote:Actually, Java 9 is the first version of Java that breaks a lot of things...
And no, I do not recommend that you upgrade all your products to Java 9 because there will be Java 10 and 11 before you are done.
Java 11 (the Fall 2018 release) is supposed to be a long-term support release. That seems the most reasonable target. Developers should of course test with the latest and greatest (9, 10, and starting in the summer, the 11 pre-release). Mop up your Java 9 issues now, because at some point, those warnings will turn into errors.



Wow. Things are starting to change in the Java world.
Now architects and other taking-decisions people have to have a deep review into the details of the new versions before to migrate things well and not migraine.
Thank you for your answer.
 
Campbell Ritchie
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jorge Ruiz-Aquino wrote:. . . So, for those kind of systems, it worth to migrate to the new runtime? . . .

Yes, even if only because the newer runtimes are faster. Until recently, backward compatibility meant that the old code would run on all runtimes, so you have the choice of updating the code or not updating it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic