MXBLOG - jdk
type: channel
link: https://mx.moonjer.com/tag/jdk/
items: 【MacOS】安装JDK并配置环境变量
items: windows配置jdk环境变量
items: CentOS配置jdk环境变量

【MacOS】安装JDK并配置环境变量
type: item
date: 2023-10-31T02:05:00+08:00
description: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home PATH=$JAVA_HOME/bin:$PATH //给环境变量赋值 export JAVA_HOME //导出使其生效 export PATH 参考链接：https://blog.csdn.net/m0_51520179/article/details/131295356

windows配置jdk环境变量
type: item
date: 2021-11-28T14:36:00+08:00
description: 1.打开系统环境变量配置2.添加 JAVA_HOMED:\Program Files\Java\jdk1.8.0_253.修改 Path%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;4.添加 CLASSPATH%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;5.验证java -versionjavajavac

CentOS配置jdk环境变量
type: item
date: 2021-11-13T20:33:00+08:00
description: 1.下载linux版1.8JDK包安装版本 jdk-8u191-linux-x64.tar.gz 为例2.解压安装包到指定目录tar -zxvf jdk-8u191-linux-x64.tar.gz3.配置环境变量并生效（1）root用户打开配置文件 /etc/profilevi /etc/profile在末尾添加以下内容：export JAVA_HOME=/home/$USER/programs/soft/jdk1.8.0_381 export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar export PATH=$PATH:${JAVA_HOME}/bin（2）普通用户vi ~/.bash_profile在.bash_profile文件中填入如下语句：export PATH export JAVA_HOME=/home/$USER/programs/soft/jdk1.8.0_381 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar4.使配置文件生效source /etc/profilesource ~/.bash_profile5.检验java环境java -version出现以下内容：java version "1.8.0_381" Java(TM) SE Runtime Environment (build 1.8.0_381-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)