Making Old Java Work
Let's bring legacy code up to JDK 9 standards.
Join the DZone community and get the full member experience.Join For Free
With Burningwave Tools, it is possible to perform dependency shrinking and also make applications created with old Java versions work on Java 9 and later versions. To adapt applications to Java 9 and later, you must create an application adapater and run it with JDK 9 or later. In this application adapter you must load, by using PathHelper, the JDK libraries the target application was developed with and pass to the method captureAndStore of the TwoPassCapturer component, as the first parameter, the name of the class of your application that contains the main method. In the example below, we're adapting a Java 8 Spring Boot application to Java 9 or later.
After preparing the dependencies adapter, you need to run it: at the end of the execution, you will find a system executable (a .cmd file under Windows and a .sh file under Unix) in the destination folder with which it will be possible to test the extracted dependencies:
In this short tutorial, we learned how to adapt a Java application to Java 9 and later, and you can download/clone the tutorial shared here on GitHub. To make it works you need:
Opinions expressed by DZone contributors are their own.