docker cp /opt/lib/java 9f953ea6f065:/opt/lib/java
自己的jdk解压目录
docker cp /opt/profile 9f953ea6f065:/etc/profile
docker cp 9f953ea6f065:/etc/profile /opt/profile
vim /opt/profile
export JAVA_HOME=/opt/lib/java/jdk1.8.0_381/
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar
docker exec -it 9f953ea6f065 /bin/bash
vim /etc/profile
docker restart 9f953ea6f065
java --version
文档更新时间: 2023-08-22 14:19 作者:admin