Upgrading to Java 11


View full screen


As you're developing with one version of Java, you may want to upgrade to a newer version for a number of reasons.

It'll be important to check compatibility with your application, with as little work as possible.

Luckily, on Platform.sh, finding out if an application works with another version of Java is quick to test.

Here, the production site is the only active environment, and by checking the Services Tab on Master you can see that it's currently using Java 8 for it's runtime.

Now let's migrate this app from Java 8 to Java 11.

In the local copy of the repository the .platform.app.yaml configuration file defines how your app is built and deployed. It also defines its runtime, so it's here that you can quickly edit the type attribute to use Java 11 instead of Java 8. You can stage, commit, and push the change to a new branch called upgrade_java_11.

Once you've pushed to the remote branch on Platform.sh, you can activate it through the management console, which will then tie an active environment to that branch. The application will start its build, now using Java 11. You can inspect the process by viewing it in the logs.

Now you have successfully deployed a Java 11 version of our application. Production hasn't been touched at all. This environment is completely isolated from Master, and comes with a byte-level copy of all of our production data. You can visit the environment's unique URL and do whatever testing necessary to merge and fully migrate the app.

Finally, you can push, deploying the identical configuration to production in seconds. You also have the option to merge the development environment directly in the management console or through an integrated external repository on GitHub, GitLab, or Bitbucket.

Our Services Tab for Master now reads Java 11, and our deployed site is unchanged for the user.

And this process can also be used for any change to your code, or for upgrading your dependencies and services.

So get out there and start migrating, with Platform.sh.

Build your greatest ever app
Get started for free