Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Java 8 Released

2014, java

It’s official – Java 8 has been released. This brings one of the biggest changes to the Java platform since the introduction of generics back in Java 5, almost a decade ago. I’ve written up some more about the release at InfoQ.

Along with the usual performance upgrades and improvements, there are some that stand out:

  • No More PermGen – the PermGen, a HotSpot limitation that meant only a certain amount of String data could be held in memory without restarting, is now gone. The Java VM will probably continue to accept the -XX:PermGen (used by many Eclipse users) with a warning saying it is no longer needed, but at some point in the future will likely be removed for good.
  • Dates and Times are now Jodafied – instead of building on the worst class in the world, JSR310 now provides sane ways of dealing with all manner of dates and times in Java. Lots of these have immediate value; date and time ranges, times without associated dates, time zones, calendars that are actually useful and even months that aren’t zero indexed.
  • Nashorn – JavaScript is a language whose importance has grown over the last few years, and being able to natively execute JavaScript code at speed will likely bring platforms like Node.JS and Vert.X to greater popularity
  • Streams – the collections libraries now have the ability to produce (in)finite streams of data which can be parallelised, processed and manipulated in many functional ways, the like of which Java developers will not have seen
  • Lambdas – last but by no means least, Java now has anonymous functions, aka ‘lambads’ (not to be confused with closures, which have existed since Java 1.1 added inner classes to the Java language). With the advances in the type inference engines, the ability to treat a single abstract method class as a target of a lambda (making writing Runnables trivial) is going to bring about the biggest single change in Java’s history. Toy languages like Groovy and Scala have shown that there is appetite for functional programming in Java, and whilst the functional behaviour doesn’t go as far or as deep as some may like, the fact that functional programming will be exposed to the mass of Java programmers in a sane and forward-compatible way is likely to see the emergence of many functional inspired APIs in the future

It’s really an exciting time to be a Java developer, or indeed, any JVM based language. The standardisation of these functions means that future JVM languages will be able to have some level of interoperability with Java, at the same time as taking advantage of the optimisations and under-the-hood improvements of the JVM.

The future of the Java language and JVM has only just begun.