{"id":228758,"date":"2022-04-11T09:00:12","date_gmt":"2022-04-11T16:00:12","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=228758"},"modified":"2022-04-11T17:10:37","modified_gmt":"2022-04-12T00:10:37","slug":"java-17-and-tomcat-10-0-available-on-azure-app-service","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-17-and-tomcat-10-0-available-on-azure-app-service\/","title":{"rendered":"Java 17 and Tomcat 10.0 available on Azure App Service"},"content":{"rendered":"<p>Earlier this year\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/java\/microsoft-build-of-openjdk-on-azure-platform-services\/\">we reported<\/a> that the Microsoft Build of OpenJDK was coming to Azure App Service in an upcoming platform update. That update has now rolled out to all regions and includes Java 17 and Tomcat 10.0, which are both <em>brand new<\/em> on App Service! These runtimes are now generally available for both Linux and Windows on App Service. Follow the instructions below to learn more and get started.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/03\/java17screenshot.png\"><img decoding=\"async\" class=\" wp-image-228782 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/03\/java17screenshot-300x257.png\" alt=\"Image java17screenshot\" width=\"528\" height=\"452\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/03\/java17screenshot-300x257.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/03\/java17screenshot.png 736w\" sizes=\"(max-width: 528px) 100vw, 528px\" \/><\/a><\/p>\n<h2>Java 17<\/h2>\n<p>Java 17 on App Service is distributed via the Microsoft Build of OpenJDK, a no-cost long-term supported distribution of the OpenJDK and Microsoft\u2019s new way to collaborate and contribute to the Java ecosystem. You can learn more about the Microsoft Build of OpenJDK from the\u00a0<a href=\"https:\/\/docs.microsoft.com\/java\/openjdk\/overview\">documentation<\/a>. Watch the video for an interview with Martijn Verburg &#8211; the Principal Engineering Group Manager for the Java Engineering Group at Microsoft &#8211; on the Microsoft Build of OpenJDK 17.<\/p>\n<p><iframe title=\"YouTube video player\" src=\"\/\/www.youtube.com\/embed\/TAELYS3xt44\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h3>Get Started<\/h3>\n<ol>\n<li><a href=\"https:\/\/docs.microsoft.com\/java\/openjdk\/download\">Download<\/a>\u00a0and\u00a0<a href=\"https:\/\/docs.microsoft.com\/java\/openjdk\/install\">install<\/a>\u00a0Java 17.<\/li>\n<li>Clone the\u00a0<a href=\"https:\/\/github.com\/spring-guides\/gs-spring-boot\">Spring Boot Getting Started<\/a> sample project\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>git clone https:\/\/github.com\/spring-guides\/gs-spring-boot\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Change directories to the completed project\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"nb\">cd <\/span>gs-spring-boot\/complete\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Build and run the application locally.\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code> mvn package\r\n java <span class=\"nt\">-jar<\/span> target\/spring-boot-complete-0.0.1-SNAPSHOT.jar\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Browse to the app at\u00a0<a href=\"http:\/\/127.0.0.1:8080\/\">http:\/\/127.0.0.1:8080<\/a>\u00a0and confirm the application is running<\/li>\n<li>Configure the Maven plugin\n<pre>mvn com.microsoft.azure:azure-webapp-maven-plugin:2.5.0:config<\/pre>\n<\/li>\n<li>The previous command will start a wizard. Select your desired operating system, Java version, and App Service Plan type. In this case, we suggest\u00a0<strong>Linux<\/strong>,\u00a0<strong>Java 17<\/strong>, and\u00a0<strong>P1v2.<\/strong>\n<pre>Define value for OS [Linux]:\r\n1: Windows\r\n<strong>* 2: Linux<\/strong>\r\n3: Docker\r\nEnter your choice: 2\r\nDefine value for javaVersion [Java 8]:\r\n* 1: Java 8\r\n2: Java 11\r\n<strong>3: Java 17<\/strong>\r\nEnter your choice: 3\r\nDefine value for pricingTier [P1v2]:\r\n1: B1\r\n2: B2\r\n3: B3\r\n4: D1\r\n5: EP1\r\n6: EP2\r\n7: EP3\r\n8: F1\r\n<strong>* 9: P1v2<\/strong>\r\n10: P1v3\r\n11: P2v2\r\n12: P2v3\r\n13: P3v2\r\n14: P3v3\r\n15: S1\r\n16: S2\r\n17: S3\r\n18: Y1\r\nEnter your choice: 9\r\nPlease confirm webapp properties\r\nSubscription Id : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\r\nAppName : spring-boot-complete-1646864850428\r\nResourceGroup : spring-boot-complete-1646864850428-rg\r\nRegion : centralus\r\nPricingTier : P1v2\r\nOS : Linux\r\nJava : Java 17\r\nWeb server stack: Java SE\r\nDeploy to slot : false\r\nConfirm (Y\/N) [Y]: Y\r\n[INFO] Saving configuration to pom.\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 02:12 min\r\n[INFO] Finished at: 2022-03-09T14:28:27-08:00\r\n[INFO] ------------------------------------------------------------------------<\/pre>\n<\/li>\n<li>Deploy the web app using the Maven plugin. This will create the App Service Plan and Web App in a new resource group.\n<pre>mvn azure-webapp:deploy<\/pre>\n<\/li>\n<li>Browse to your newly created web app! In the log output from the previous command there will be a URL to your web app.\n<pre>[INFO] Successfully deployed the artifact to https:\/\/spring-boot-complete-1646864850428.azurewebsites.net\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 02:58 min\r\n[INFO] Finished at: 2022-03-09T15:25:36-08:00\r\n[INFO] ------------------------------------------------------------------------<\/pre>\n<\/li>\n<\/ol>\n<p>Prefer Gradle? See the <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\">Azure Plugins for Gradle<\/a>! You can accomplish the same tasks shown in this article using the <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\/blob\/master\/azure-webapp-gradle-plugin\/README.md\">Azure Web App Plugin for Gradle<\/a>. Version 1.3.0 supports Java 17. Updates to the Azure integrations for VS Code and IntelliJ will be available soon.<\/p>\n<h2>Tomcat 10.0<\/h2>\n<p>Tomcat 10.0 builds on Tomcat 9.0.x, supports Java 8 and later, and is the first Tomcat release to migrate from the Java EE 8 specification to Jakarta EE 9. This means that Tomcat 9.0 or 8.5 applications will require a refactor and rebuild to run on Tomcat 10.0 in almost all cases. <a href=\"https:\/\/github.com\/Azure-Samples\/tomcat10-jakartaee9\">This sample application<\/a> illustrates the code changes that must be made to migrate a Tomcat 9 application from Java EE APIs to Jakarta EE APIs. For more information, please refer to <a href=\"https:\/\/tomcat.apache.org\/migration-10.html\">the official Tomcat 10.0 migration guide<\/a> on the Apache Tomcat website for guidance on migrating Tomcat 9.0 and 8.5 applications to Tomcat 10.0. Tomcat 10 on App Service is supported for Java 8, 11, and 17. It is distributed with Eclipse Temurin for Java 8, and Microsoft Builds of OpenJDK for Java 11 and 17.<\/p>\n<p>Note that Tomcat 10.<strong>1<\/strong>\u00a0is\u00a0<a href=\"https:\/\/tomcat.apache.org\/tomcat-10.1-doc\/index.html\">currently in alpha <\/a>and will be a separate release of Tomcat from Tomcat 10.<strong>0<\/strong>. Tomcat 10.<strong>1<\/strong> will only support Java 11 and later. App Service will support Tomcat 10.<strong>1<\/strong> once a stable release is published by the Apache Foundation. For more information about Tomcat versions and their support statuses, see <a href=\"https:\/\/tomcat.apache.org\/whichversion.html\">the Tomcat support matrix<\/a> on the official Apache Tomcat site.<\/p>\n<h3>Get Started<\/h3>\n<ol>\n<li>Ensure that you\u2019re using Java 8 or greater on your local machine<\/li>\n<li>Use Maven to generate a sample application\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><strong><code>mvn archetype:generate <span class=\"s2\">\"-DgroupId=example.demo\"<\/span> <span class=\"s2\">\"-DartifactId=helloworld\"<\/span> <span class=\"s2\">\"-DarchetypeArtifactId=maven-archetype-webapp\"<\/span> <span class=\"s2\">\"-Dversion=1.0-SNAPSHOT\"<\/span>\r\n<\/code><\/strong><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Move into the project folder\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><strong><code><span class=\"nb\">cd <\/span>helloworld<\/code><\/strong><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Configure the Maven plugin\n<pre>mvn com.microsoft.azure:azure-webapp-maven-plugin:2.5.0:config<\/pre>\n<\/li>\n<li>The previous command will start a wizard. Select your desired operating system, Java version, and App Service Plan type. In this case, we suggest\u00a0<strong>Linux<\/strong>, <strong>Tomcat 10.0<\/strong>, <strong>Java 17<\/strong>, and\u00a0<strong>P1v2.<\/strong>\n<pre>Define value for OS [Linux]:\r\n1: Windows\r\n<strong>* 2: Linux<\/strong>\r\n3: Docker\r\nEnter your choice: 2\r\nDefine value for webContainer [Tomcat 8.5]:\r\n1: Jbosseap 7\r\n2: Tomcat 10.0\r\n* 3: Tomcat 8.5\r\n4: Tomcat 9.0\r\nDefine value for javaVersion [Java 8]:\r\n* 1: Java 8\r\n2: Java 11\r\n<strong>3: Java 17<\/strong>\r\nEnter your choice: 3\r\nDefine value for pricingTier [P1v2]:\r\n1: B1\r\n2: B2\r\n3: B3\r\n4: D1\r\n5: EP1\r\n6: EP2\r\n7: EP3\r\n8: F1\r\n<strong>* 9: P1v2<\/strong>\r\n10: P1v3\r\n11: P2v2\r\n12: P2v3\r\n13: P3v2\r\n14: P3v3\r\n15: S1\r\n16: S2\r\n17: S3\r\n18: Y1\r\nEnter your choice: 9\r\nPlease confirm webapp properties\r\nSubscription Id : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\r\nAppName : spring-boot-complete-1646864850428\r\nResourceGroup : spring-boot-complete-1646864850428-rg\r\nRegion : centralus\r\nPricingTier : P1v2\r\nOS : Linux\r\nJava : Java 17\r\nWeb server stack: Java SE\r\nDeploy to slot : false\r\nConfirm (Y\/N) [Y]: Y\r\n[INFO] Saving configuration to pom.\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 02:12 min\r\n[INFO] Finished at: 2022-03-09T14:28:27-08:00\r\n[INFO] ------------------------------------------------------------------------<\/pre>\n<\/li>\n<li>Build and deploy the web app using the Maven plugin. This will create the App Service Plan and Web App in a new resource group.\n<pre>mvn package azure-webapp:deploy<\/pre>\n<\/li>\n<li>Browse to your newly created web app! In the log output from the previous command there will be a URL to your web app. Follow that URL to your web app.\n<pre>[INFO] Successfully deployed the artifact to https:\/\/helloworld-1646868651868.azurewebsites.net\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD SUCCESS\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 01:06 min\r\n[INFO] Finished at: 2022-03-09T15:47:24-08:00\r\n[INFO] ------------------------------------------------------------------------<\/pre>\n<\/li>\n<\/ol>\n<p>Prefer Gradle? See the <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\">Azure Plugins for Gradle<\/a>! You can accomplish the same tasks shown in this article using the <a href=\"https:\/\/github.com\/microsoft\/azure-gradle-plugins\/blob\/master\/azure-webapp-gradle-plugin\/README.md\">Azure Web App Plugin for Gradle<\/a>. Version 1.3.0 supports Tomcat 10.0. Updates to the Azure integrations for VS Code and IntelliJ will be available soon.<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service\/configure-language-java?pivots=platform-linux\">Configure Java apps &#8211; Azure App Service | Microsoft Docs<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/learn\/modules\/intro-to-java-azure\/\">Introduction to Java on Azure &#8211; Learn | Microsoft Docs<\/a><\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\"><code style=\"font-size: 14.4px;\"><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Earlier this year\u00a0we reported that the Microsoft Build of OpenJDK was coming to Azure App Service in an upcoming platform update. That update has now rolled out to all regions and includes Java 17 and Tomcat 10.0, which are both brand new on App Service! These runtimes are now generally available for both Linux and [&hellip;]<\/p>\n","protected":false},"author":20976,"featured_media":227205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-228758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"blog_post_summary":"<p>Earlier this year\u00a0we reported that the Microsoft Build of OpenJDK was coming to Azure App Service in an upcoming platform update. That update has now rolled out to all regions and includes Java 17 and Tomcat 10.0, which are both brand new on App Service! These runtimes are now generally available for both Linux and [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/20976"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=228758"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/228758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/227205"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=228758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=228758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=228758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}