This topic provides an overview of the fundamental concepts and key components of a Java web environment, helping you to choose an appropriate deployment strategy based on your needs. Once deployed, the environment facilitates the development, deployment, and execution of Java web applications customized to your requirements.
What is a Java web environment?
The Java technology stack is widely used in web development, catering to the demands of Internet applications and offering ample flexibility for future expansion. As a result, it is a popular choice among businesses and individual developers. A Java web environment includes a configuration set that facilitates the development, testing, and deployment of web applications using Java technology. The primary components include the following:
JDK: The Java Development Kit (JDK) is essential for Java development, providing the necessary tools and runtime environment. With JDK installed, you can compile and execute Java programs.
Web server: Web servers such as Tomcat and Jetty are responsible for deploying and running Java web applications.
Database: Databases such as MySQL are used for storing and managing data within web applications, ensuring data persistence.
Deploy a Java web environment
Select the most suitable deployment method based on your needs.
Method | Scenario |
Deploying with an Alibaba Cloud Marketplace image (CentOS 7.3 to CentOS 7.9) | This method uses an Alibaba Cloud Marketplace image with a pre-integrated environment. You can directly use it without the need for server installation or deployment. |
For developers with specific needs or those seeking a deeper understanding of each component functionality, manual deployment offers the most hands-on approach. |
What to do next
After deploying a Java web environment, you may want to configure a website on the server. For detailed instructions, see Build a website.
Choose the right development tools for web development. If your application requires database storage, add database configurations to the configuration files of your web project, such as Properties files, to connect to the database. After you complete the development, you can deploy the Java web application to a web server such as Tomcat. Once your application is deployed and running, you can access the application through the web browser. For detailed instructions, see the Tomcat 9 Application Deployment Guide.
For other versions of Tomcat, update the version number in the URL to match your version.
To upload local files to ECS, see Upload a file to a Linux instance.