![]() Now your Docker file will look like this: FROM tomcat:10-jdk17īefore we start the migration from javax to jakarta let's run the project again from the run icon in the gutter of the docker-compose.yml file adjacent to services because we want the image to be rebuilt. This project uses Docker, so you can update the version of Apache Tomcat from 9 to 10 in your Docker file: FROM tomcat:9-jdk17ĪDD target/MyWebApp.war /usr/local/tomcat/webapps/MyWebApp.war This application is currently running Apache Tomcat 9.0 which uses the javax namespace. If you enter a name and fruit, they should successfully be persisted in the database. Now you should be able to navigate to localhost:8080/MyWebApp and see the application. Once you have downloaded the code, you can use the run icon in the gutter of the docker-compose.yml file: Either way you will need Docker running on your machine. If you are following along, I recommend that you use IntelliJ IDEA Ultimate, however you can use IntelliJ IDEA Community Edition and install the Docker plugin manually. Clone the project from GitHub if you want to follow along and check out the javax branch, we will start here. You can get the sample code from GitHub, with thanks to Dalia for creating the project! There are three branches in this project main, javax and jakarta. SpringBoot also made this change in version 6. However, Apache Tomcat recently released version 10 which updated package names from javax to jakarta. Fundamentally the Java Persistence API was renamed to Jakarta Persistence API meaning that the javax namespace changed to jakarta for frameworks whose APIs have moved to Jakarta EE (which is not all of them). If you want the history on this change, check out this helpful blog post from Java Magazine. In this post, we're going to migrate some sample code from the javax namespace to jakarta. She has over 20 years’ experience in the software industry which has been gained in a variety of roles including developer, technical. Helen is a Java Developer Advocate at JetBrains.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |