This topic describes how to quickly install OpenJDK on an ECS instance by using an extension.
For batch installations, log on to the CloudOps Orchestration Service console. In the left-side navigation pane, choose , and then select Java.
Limitations
-
The instance must meet the following requirements to use this feature:
-
The ECS instance is created from a public image.
-
The ECS instance is in the Running state.
-
Cloud Assistant is installed on the ECS instance, and the Cloud Assistant agent is in the Normal state.
-
-
If you are a RAM user, use the following custom policy to grant the minimum required permissions.
Procedure
-
Log on to the ECS console - Instances. Locate the target ECS instance and click the instance ID to go to the instance details page.
-
Choose .
-
In the Install Extension dialog box, set Extension to be Installed to Java and click Next. Follow the on-screen instructions. On the configuration parameters panel, click the public extension tab, select Java, and then select an extension version. In the Parameters in Command section, select the Java version to install from the version drop-down list. Available versions include 21.0.6, 17.0.14, 11.0.26, and 1.8.0_441, where 1.8.0_441 corresponds to Java 8 (8u441) LTS.
When the task status is Completed, this indicates that Java is installed. After the installation is complete, you can view the task execution record on the Installation/Uninstallation History tab. When the task status is displayed as Succeeded, this means the extension was installed successfully.
-
Connect to the ECS instance and run the following command to verify the Java installation and version.
java -version[root@iZbp1jxxx java]# java -version openjdk version "1.8.0_441" OpenJDK Runtime Environment (build 1.8.0_441-b06) OpenJDK 64-Bit Server VM (build 25.441-b06, mixed mode)