This topic describes the basic concepts and main components of a Java Web environment. You can choose a deployment method based on your scenario. After you deploy the environment, you can develop, deploy, and run Java web applications.
What is a Java Web environment
The Java technology stack is a popular choice for many businesses and individual developers. It meets the demands of modern internet applications and provides the flexibility to handle future challenges. A Java Web environment is a set of configurations that supports the development, testing, and deployment of web applications using Java technology. It typically includes the following components:
JDK: The Java Development Kit (JDK) is a software development kit for Java. It provides a development and runtime environment for Java. After you install the JDK, you can compile and run Java programs.
Web server: A web server can deploy and run Java web applications. Common web servers include Tomcat and Jetty.
Database: A database stores and manages data for your web application to ensure data persistence. A common database is MySQL.
How to deploy a Java Web environment
Choose a deployment method based on your requirements.
Method | Scenarios |
Deploy a Java Web environment from an Alibaba Cloud Marketplace image (CentOS 7.3 and CentOS 7.9) | If you want to avoid manually installing and configuring a server, you can use an Alibaba Cloud Marketplace image with a pre-installed environment to deploy a Java web server. |
Manually deploying the environment is ideal for developers who have specific requirements or want to understand how each component works. You can choose to deploy the environment with Tomcat or Jetty based on your application scenario.
| |
What to do next
After you deploy the Java Web environment, you can configure a website on the server. For more information, see Build a website.
Choose a suitable development tool for web development. If your application requires a database, add the database connection details to the relevant configuration file of your project, such as a Properties file. After development, deploy the Java web application to a web server, such as Tomcat. After the application is deployed and running, you can access it from a web browser. For more information, see the Tomcat 9 Application Deployer HOW-TO.
NoteIf you use a different version of Tomcat, replace the version number in the URL with your version number.
To upload local files to an ECS instance, see Upload or download files (Linux).
You can use the Build and Deploy feature of ECS to associate a code repository and then build and deploy your application. For more information, see Deploy business code to an ECS instance.
You can also use Apsara Devops to create a continuous integration/continuous delivery (CI/CD) pipeline to improve efficiency. For more information, see What is Apsara Devops?.