The article includes the following points:
- The Main Specifications of Java 10
- Getting Java 10 Environment
- Create a New Environment
- Updating Running Application Server
Recently, the Oracle team announced the adoption of a new long-term Java development plan which actually confused the Java development community. For integrating this plan, a new JDK version needs to be released every 6 months with the provision of the major long-term supported (LTS) engine once per 3 years. In the similar manner, on the launch of recent Java 9 implementation, there was introduction of the next Java SE Development Kit 10 (JDK 10) just a few weeks ago.
We are always keeping a track of the latest development tendencies and technologies and so, we are glad to declare that you can now implement the JDK 10 support for Tomcat 8/9, TomEE application servers and Maven build node within MilesWeb cloud powered by Jelastic (while the rest of Java-based stack templates will be upgraded in the nearest future).
Let’s check the most significant innovations and changes brought by Java 10 and learn the migration of your application to the newest engine version (or, if you are a new MilesWeb user, to create your first environment based on JDK 10) within the MilesWeb cloud powered by Jelastic.
The Main Specifications of Java 10
What are the reasons behind Java 10 gaining such a big hype? Below are the important changes you need to be aware of while deciding to migrate to the currently newest engine version:
- Local variable type inference – You can declare the inner server variable (i.e. those which are used inside methods or code blocks) using the var keyword without specifying their type directly as it will be automatically identified by considering the context of variable usage. This helps in reduction of the code required to plan the appropriate settings, especially in limits of complex list types.
- Garbage Collector (GC) performance improvements – By default, multiple embedded garbage collectors can be found embedded inside (each of which is designed to fulfill particular requirements) every Java VM, while the most appropriate is automatically selected and enabled. The source-code isolation of various garbage collectors is improved by JDK 10 for providing clutter-free GC interface and easing the addition of new one. Additionally, there was reduction in the latency during the full GC calls of the default G1 garbage collector due to the parallelism implementation.
- Common repository for all JDK components – Collection of multiple repos of JDK code base was done within a single repository to avoid any issues with source-code management and streamline development.
- Improved Docker awareness –Access to the container-specific information (for example, number of CPUs and total memory amount, allocated to a node) will be given to JVM, if it is running inside a Docker container instead of querying operation system each time such data is needed. Also, there was addition of few extra JVM options so that the Docker container users can control system memory in a better way.
You can view the complete release notes at the official website. Below you can the process of reaping these benefits by migrating your application to Java 10.
Getting Java 10 Environment
Below are the steps to run your Java application based on the JDK 10 in Milesweb:
- Create the appropriate new environment
- Redeploy the already existing server to switch the engine version
You can perform these processes in a simple and straightforward way with convenient MilesWeb UI.
Create a New Environment
1. Log into your MilesWeb cloud platform and click on the New environment tab in the upper left corner of the dashboard:
2. A new window will open, navigate to the Java tab, select the required application server (Tomcat 8, Tomcat 9 or TomEE in our case) and select the JDK 10 tag within its central frame.
3. It will just take a minute to create your environment.
That’s it! Your Java 10 environment is ready!
Updating Running Application Server
1. Go to the layer with Application Servers that you want to upgrade and click on the Redeploy containers button.
2. A new frame will open where you can choose a stack with another engine version by selecting the appropriate Tag from the list.
3. It will take several minutes and the operation success notification window will appear.
Congratulations! Now your application is running in concurrence with Java 10!
In order to ensure this and check the exact Java version your application server is run on, connect to it via SSH (e.g. using the embedded Web SSH client) and perform the following command:
In response to the command, you will find the currently used version of Java engine. Next, you can proceed with the deployment of application in any way you want – from an archive file, remote GIT/SVN repository or by means of plugins (Eclipse, Ant Task, Maven, IDEA, NetBeans).
Want to experience the Java 10 support at MilesWeb? Try Java 10 on cloud for free by signing up for a month’s trial period at our MilesWeb cloud platform.