In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to deploy JAVA environment in Docker". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to deploy JAVA environment in Docker.
01
-
Docker CentOS Image
Find the CentOS version in Docker Hub, find the official CentOS image, and download centos7
Let it download first, we use the host to download JDK.
Log in to Oracle and choose JDK 11 to download (choose the version you use, which I have never used before. Try it!), get the directory of the host after the download is complete. My current absolute path is
D:\ jdk-11.0.4_linux-x64_bin.tar.gz
02
-
Start the container
Docker run-d-I-t / bin/bash
So we created a docker container
Copy JDK to the container
The JDK you just downloaded needs to be copied into the container for installation.
Docker cp D:\ jdk-11.0.4_linux-x64_bin.tar.gz 009afb75760f:/
Next we execute docker exec-it 009afb75760f / bin/bash to enter the container
Currently, execute ls in the root directory to see the jdk package under the current path, and execute the decompression command.
03
-
Set environment variabl
Vim / etc/profile (install vim yourself and get used to using vim)
Set up JAVA_HOME
Set up PATH
Save, exit
Source / etc/profile makes the configuration effective, and then executes java-version to check the installation version information. If you return successfully, the installation is successful.
At this point, I believe you have a deeper understanding of "how to deploy the JAVA environment in Docker". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.