Java Versions wise Feature History
13 min readApr 23, 2020
Java has evolved constantly.
JDK 1.0
- WORA
Java was developed for the main feature Write Once and Run Anywhere (WORA) . That means unlike other programming languages of that time , compiled java code can run on all platforms which supports java , without need of recompiling again.Java bytecode can run on any JVM.
JDK 1.1
- JDBC
It created industry standard for database-independent connectivity between the Java and many databases. This feature enhanced the our main purpose WORA. as our programming become database independent as well - Inner Class
Inner class enabled developers to create class which is useful for only one class. Inner class can be static / non-static, nested, anonymous. They become very helpful in abstracting data from outer classes. - JAVA BEANS
Beans enabled to classes to encapsulate many objects in single class. - RMI
The RMI (Remote Method Invocation) allows an object to invoke methods on an object running in another JVM.The RMI is an API that provides a mechanism to create distributed application in java. - Reflection
Java Reflection enabled developers modify the behaviour of class runtime. It lets you write programs that do not have to “know” everything at compile time, making them more dynamic, since they can be tied together at runtime.
Most of the modern frameworks use reflections.
JDK 1.2
- Collection Framework
Collections framework reduced the grunt work of rewriting and implementing data structures and algorithms all the time. It also increased performances related to DS-algo , increased reusability and portability. - Java String memory map for constants
It started storing Strings in heap memory of string pool. So it ensured that there can not be two string objects with same content in the string constant pool. It became very useful in having string object as a key for hashmaps. - JIT
The Just-In-Time (JIT) compiler is a component of the Java Runtime Environment that improves the performance of Java applications at run time.The JIT compiler compiles the bytecode of that method into native machine code, compiling it “just in time” to run. When a method has been compiled, the JVM calls the compiled code of that method directly instead of interpreting it - JAR Signer
Jar signing is the process of applying a digital signature to a jar file so the receiver of, using your public key, can verify its authenticity. - Policy Tool for granting access to system resources.
In Java, this allows a programmer to establish a customised security policy for a Java application or applet and give the application access or permissions outside of the usual Java sandbox - JFC (Java Foundation Classes)
AWT existed before JFC. AWT was heavily criticised for being little more than a wrapper around the native graphical capabilities of the host platform. That meant that the standard widgets in the AWT relied on those capabilities of the native widgets, requiring the developer to also be aware of the differences between host platforms. JFC overcame this issue by AWT, Swing, Java2D apis. - Java plugin
Java Plug-in technology, included as part of the JRE, establishes a connection between popular browsers and the Java platform. This connection enables applets on Web sites to be run within a browser on the desktop. - Scrollable result sets, BLOB, CLOB, batch update, user-defined types in JDBC
These features added enhancements to result set functionality, such as processing forward or backward, positioning relatively or absolutely, seeing changes to the database made internally or externally, and updating result set data and then copying the changes to the database. - Audio support in Applets.
It enabled applets to play audio files.
JDK 1.3
- JAVA Sound
Java sound API enabled java to do development in communication, telephony , music , etc. - Jar Indexing
It enabled jar indexing in java. - Apart from these in Java 1.3 there were many small updates in existing features in multiple parts of java
JDK 1.4
- XML processing
This feature enabled java to process XML effectively instead of writing parsers all the time. - Print Service
The Java Print Service API allows printing on all Java platforms including those requiring a small footprint, such as a Java ME profile, but also supports the JWT - Logging API
It made logging very effective with many logging levels like debug, info , warn , error, etc. - Java Web Start
The Java Web Start software allows you to download and run Java applications from the web. - JDBC 3.0 api
It added many feature in JDBC such as Set save points in a transaction. Keep result sets open after a transaction is committed. Reuse prepared statements. Get metadata about the parameters to a prepared statement. Retrieve keys that are automatically generated. Have multiple result sets open at one time - Assertions
Assertions helped debugging and testing by the by which we can enable or disable throw exceptions on false value. - Preferences API
Many a times our programs are required to store/access smaller amount of data, like user preferences, or system preferences. This data is so small that it is too expensive to use DB layer. Properties file also don’t have standards and where to store making difficult for cross platforms. Java preference api allows to store such things. Making development platform independent. - Chained Expressions
It allowed chaining of multiple methods in a single sentence without storing intermediate results. - IPV6 support
It enabled java with IPV6 as well - Regex
Regex enabled java in patter matching - Image I/O
For input / output of images. Which opened doors for image processing.
JDK 5.0
- Generics
Generic made easier to force typeSafety in writing methods and classes which earlier used Objects only . for any type of objects. - Enhanced for loop
Enabled developers to write loops asfor (int i : arr) { }
instead of counters - Autoboxing / Unboxing
Autboxing helped inter casting between Boxed type and primitive types . - TypeSafe enums
Introduced enums, so that we can’t assign other values than specified values. which enabled developers to create their own datatypes - Varargs
It allowed to take variable length of arguments in methods . instead of array passing. Ex: public int methodName(int … A){return 0}; - Static import
It allows members which have been scoped within their container class as public static, to be used in Java code without specifying the class in which the field has been defined. - Metadata — Annotations
Multiple annotations added to make codes fail proof as well as reduced coding efforts. Ex @ Override , @ Deprecated, etc - Instrumentation
It provides the ability to add byte-code to existing compiled Java classes.
JDK 6.0
- Scripting Language Support
It enabled java and JVM to support variety of scripting languages including python , R , etc. - JDBC 4.0
It added many features like datasources, SQL exceptions, Autoloading of JDBC drivers. - Java Compiler api
Compiler apis enabled developers to interact with compilers at the run time . For the tasks like annotation processing , etc - Pluggable Annotations
For runtime annotation processing it was possible to use reflections. But for compile time annotation processing pluggable annotation was required for java. - Native PKI, Java GSS, Kerberos and LDAP support
It enabled java to use LDAP with proper authentication for accessing and marinating distributed information services. - Integrated Web Services.etc
Integrated web service enabled java error free handling of REST, SOAP and different kind of web-service
JDK 7.0
- Strings in switch Statement
It enabled using String type in Switch statements - Type Inference for Generic Instance Creation and Diamond Syntax
Improved compiler which is enough smart to infer the type of generic instance. ex. we can write nowList<Integer> list = new ArrayList<>();
instead ofList<Integer> list = new ArrayList<Integer>();
- Multiple Exception Handling
Catch block can be written with pipe separated exceptions instead of chaining of multiple catch blocks one below another - Support for Dynamic Languages
Java is statically typed language where you need to specify and mention each and every thing before using it. You must know beforehand only what you are going to use. But to create a dynamically typed language on above of java it was not possible or not not efficient before this support.Here invokeDynamic of java 7 comes to rescue - Try with Resources
Try statement can declare one or more resources inside so that they can be closed automatically and avoiding memory leaks.Extry(BufferReader br = new BufferReader(new FileReader(Path))){/***/}catch(Exception e){/***/}
- Java NIO Package
NIO introduced non blocking , buffer based inputstreams which improved performance over blocking stream bases IO - Binary Literals, underscore in literals
In java now we can use binary literal and as well as underscore in int . Exint a = 100_000; int b = 0b10101;
JDK 8.0
- Lambda Expressions
One issue with anonymous classes is that if the implementation of your anonymous class is very simple, such as an interface that contains only one method, then the syntax of anonymous classes may seem unwieldy and unclear. In these cases, you’re usually trying to pass functionality as an argument to another method, such as what action should be taken when someone clicks a button. Lambda expressions enable you to do this, to treat functionality as method argument, or code as data. This made java a functional programming language. - Pipelines and Streams
A stream is not a data structure that stores elements; instead, it conveys elements from a source such as a data structure, an array, a generator function, or an I/O channel, through a pipeline of computational operations. - Date and Time API
It gave in default implementation of date and time , calendar and timezone handelling so that making coding no error prone. - Default Methods
Default methods enable you to add new functionality to the interfaces of your libraries and ensure binary compatibility with code written for older versions of those interfaces. - Type Annotations
Type annotations were created to support improved analysis of Java programs way of ensuring stronger type checking.Before the Java SE 8 release, annotations could only be applied to declarations.Now can be used anywhere you use a type. - Nashhorn JavaScript Engine
Nashorn Javascript Engine is part of Java SE 8 and competes with other standalone engines like Google V8. Nashorn extends Javas capabilities by running dynamic javascript code natively on the JVM. - Concurrent Accumulators
Concurrent adders, atomic integers made java much more handy with multithreading. - Parallel operations
Java 8 introduced so many multithreading related things like, different types of locks, atomic integers, concurrent collections, parallel stream etc. Which made java code highly extensible , maintainable and readable even in multithreading as well. - PermGen Error Removed
RemovedMaxPermSize=512m;
as it was it was creating difficulties in tuning of java heap spaces , GC and memory allocations . So out of memory exceptions are now less likely to occur . - TLS SNI
SNI stands for Server Name Indication and is an extension of the TLS protocol. It indicates which hostname is being contacted by the browser at the beginning of the handshake process. This technology allows a server to connect multiple SSL Certificates to one IP address and gate. Java 8 added support for this technology in network package
JDK 9.0
- Modularisation of the JDK under Project Jigsaw.
It added module system in the Java language. Developers can organise their code into modules and declare dependencies between them in their respective module definition files. This removed errors of multiple versions of the JARs lying on the classpath, resulted in the ClassLoader loading the first found class from the JAR, with very unexpected results. - Provided Money and Currency API.
Money and currency api made easy handelling of different currency and exchange related issues which developers needed to handle it explicitly. - Tight integration with JavaFX.
It made javaFx modularized to so that testing became independent and easy . It also revealed some of the APIs which were only available internally. - More Concurrency Updates.
There were many new updates regarding concurrency such that , completable future got .complete() method which will complete task without any synchronous wait . It allows building a pipeline data process in a series of actions. - Provided Java Linker
It provide new command line tool which helps in independant testing of modules and classes. Earlier to run simple hello world we needed to install whole JRE which have around 4000+ .class files. But to run simple hello world we needed only 4–5 .class files. This become easy with Jlink tools. - Automatic scaling and sizing in GUI
Prior to this release, on Windows and Linux, Java applications were sized and rendered based on pixels, even on HiDPI displays that can have pixel densities two to three times as high as traditional displays. This led to GUI components and windows that were too small to read or use - Apart for these
Java 8 also have many improvements in each and most of the areas including anonymous classes, diamond operators, Jshell, Collecttions factory method, new image format , new and enhances previous annotations, AWT swing improvements ,etc
JDK 10
- Local-Variable Type Inference
LVTI is a feature that allows the developer to skip the type declaration of with local variables (those defined inside method definitions, initialization blocks, for-loops, and other blocks like if-else), and the type is inferred by the JDK only. - GRAAL Dynamic compiler
Graal will use the JVM compiler interface (JVMCI) introduced in JDK 9. Graal is already in the JDK, so enabling it as an experimental JIT will primarily be a testing and debugging effort. - Application Class-Data Sharing
This allows application classes to be placed in the shared archive to reduce startup and footprint for Java applications. Currently CDS only allows the bootstrap class loader to load archived classes. Application CDS allows the built-in system class loader, the built-in platform class loader, and custom class loaders to load archived classes. - Time-Based Release Versioning
Unlike the old releases, the new time-based releases will not be delayed and features will be released every six months, with no constraints on what features can go out in the releases. - Parallel Full GC for G1
The G1 garbage collector is designed to avoid full collections, but when the concurrent collections can’t reclaim memory fast enough. With this change, a fall back full GC will occur. - Garbage-Collector Interface
Earlier scattered throughout various parts of the code base .It is a clean interface within the JVM source code to allow alternative collectors to be quickly and easily integrated. It will improve source-code isolation of different garbage collectors. - Additional Unicode Language-Tag Extensions
It included multiple tags in unicode , like currencies, first day of week, timezones and regions etc. - Root Certificates
The cacerts keystore will be populated with a set of root certificates issued by the CAs of Oracle’s Java SE Root CA Program. Earlier it was empty .This will also mean that both Oracle & Open JDK binaries will be functionally the same. Critical security components such as TLS will work by default in OpenJDK builds going forward. - Thread-Local Handshakes
This JEP lays the groundwork for improved VM performance, by making it possible to execute a callback on application threads without performing a global VM safepoint - Heap Allocation on Alternative Memory Devices
The goal of this change is to enable the HotSpot VM to allocate the Java object heap on an alternative memory device, such as an NV-DIMM, specified by the user. - Remove the Native-Header Generation Tool — javah
It will remove thejavah
tool from the JDK, a separate tool to generate header files when compiling JNI code, as this can be done throughjavac
. - Consolidate the JDK Forest into a Single Repository
In JDK 9 there are eight repos:root
,corba
,hotspot
,jaxp
,jaxws
,jdk
,langtools
, andnashorn
. In the consolidated forests, code for Java modules is generally combined under a single top-levelsrc
directory
JDK 11
- Running Java File with single command
One major change is that you don’t need to compile the java source file withjavac
tool first. You can directly run the file with java command and it implicitly compiles. - New utility methods in String class
strip(), stripLeading(), stripTrailing() , etc most commonly used methods are added to enhance the utility of String class - Local-Variable Syntax for Lambda Parameters
We can use Java 10s LVTI for lamba expressions as well - Nested Based Access Control
It introduces three methods in the reflection API:getNestHost()
,getNestMembers()
, andisNestmateOf()
. It give access to methods of nested classes by reflection - HTTP/2 Client
Http client now supports http/2 protocol as well. - Reading/Writing Strings to and from the Files
It added readString() and writeString() methods from file to make String read/write convenient and easy . - Flight Recorder
JFR is a profiling tool used to gather diagnostics and profiling data from a running Java application.Its performance overhead is negligible and that’s usually below 1%. Hence it can be used in production applications. It is made open source
JDK 12
- Switch Expressions
To prevent logical errors now switch case can have multiple comma separated values in case. - File mismatch() Method
It will compare to files and return first byte where file is different . ans it can also check if size of two files is different. - Compact Number Formatting
This feature can convert numbers into its different compact types. Ex 2100 to 2.1K etc - Teeing Collectors in Stream API
This collector has three arguments — Two collectors and a Bi-function.
All input values are passed to each collector and the result is available in the Bi-function. - Java Strings New Methods
indent(), transform(), describeConstable(), and resolveConstantDesc() These methods improves utility of string class upto much extent. - Pattern Matching for instanceof
we can now directly write if(obj instanceOf String s) which avoids typecasting again and makes code easy readable. - Raw String Literals is Removed From JDK 12.
Raw string literals causing lot of confusions while using \n , escape chars and others. And it was taking unnecessary lines of code. Now we can preview them directly.
JDK 13
- Text Blocks
This is a preview feature. It allows us to create multiline strings easily. The multiline string has to be written inside a pair of triple-double quotes. The string object created using text blocks has no additional properties. It’s an easier way to create multiline strings. We can’t use text blocks to create a single-line string. - Switch Expressions Enhancements
Enhanced switch statement block and break is replaced with yeild to return value. - Reimplement the Legacy Socket API
The underlying implementation of the java.net.Socket and java.net.ServerSocket APIs have been rewritten. The new implementation, NioSocketImpl, is a drop-in replacement for PlainSocketImpl. It uses java.util.concurrent locks rather than synchronized methods - Dynamic CDS Archive
Class data sharing made more easy to use. - ZGC: Uncommit Unused Memory
The Z Garbage Collector enhanced to return memory to improve performance on small memory devices. - FileSystems.newFileSystem() Method
It is made easier to handle filesystems in Java. - Support for Unicode 12.1
Unicode characters support increased. - DOM and SAX Factories with Namespace Support
There are new methods to instantiate DOM and SAX factories with Namespace support.
JDK 14
- Switch Expressions (Standard)
Made all changes introduced in java 11, java 12, java 13 for switch expressions in a standard way to write switch blocks - Helpful NullPointerExceptions
Enhanced JRE which can state at which point null pointer exception occurred instead of long stacktrace. - Records
A record type is a data class that stores pure data. The idea behind introducing records is to quickly create simple and concise classes devoid of boilerplate code.It will autogenerate private final fields with constructors and getter setter with equal and hashcode methods - Text Blocks
Improved text block preview features. - Apart from these there are additional new enhancements in JRE, JVM and GC .
Packaging Tool (Incubator) ,NUMA-Aware Memory Allocation for G1 , JFR Event Streaming , Non-Volatile Mapped Byte Buffers , ZGC on macOS , ZGC on Windows , Foreign-Memory Access API (Incubator)