windows环境配置

每次重装系统都需要重新配置一遍环境,索性将配置步骤记录下来,方便以后重装系统后使用

windows 环境配置(win10/11)

开发环境配置

java

下载jdk8 安装包(
需要登录 oracle),环境变量设置参数如下:

1
2
3
4
5
6
7
8
变量名:JAVA_HOME
变量值:D:\soft\java\jdk8

变量名:CLASSPATH
变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

变量名:Path
变量值:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
  • JAVA_HOME要根据自己的实际路径配置
  • CLASSPATH记得前面有个”.”
  • Path最前面新增变量值

python

下载 python 安装包,安装之后如果没勾选添加 python.exe
到系统变量,环境变量需要设置参数如下:

1
2
变量名:PYTHON_HOME
变量值:D:\soft\python
  • 只有 python 的免安装版本需要配置
  • PYTHON_HOME的路径根据自己 python 的实际路径配置

go

  1. 下载go 安装包

  2. 新建环境变量GOROOT ,值为 go 安装目录 例如 D:\soft\go

  3. 执行下面的命令修改 GOPROXY

    1
    go env -w GOPROXY=https://goproxy.cn,direct

git

  1. 下载 git 安装包
    并安装,需要勾选添加 git 到环境变量

  2. 配置用户名邮箱

    1
    2
    git config --global user.name "用户名"
    git config --global user.email "邮箱"
  3. 配置代理

    1
    2
    3
    4
    5
    6
    7
    # 设置代理
    git config --global http.proxy 'socks5://127.0.0.1:10808'
    git config --global https.proxy 'socks5://127.0.0.1:10808'

    # 取消代理
    git config --global --unset http.proxy
    git config --global --unset https.proxy

    sock5 代理地址根据实际情况修改

maven

  1. maven 归档库
    下载压缩包,解压缩到软件目录
  2. 新建系统变量 MAVEN_HOME 变量值:D:\soft\apache-maven-3.6.3
  3. Path 最后面添加变量值: ;%MAVEN_HOME%\bin
  4. 配置 settings.xml 该文件位于 maven 安装目录 conf下 配置如下
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    <?xml version="1.0" encoding="UTF-8"?>

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <!-- 本地仓库路径 -->
    <localRepository>D:\mvn_repo</localRepository>

    <mirrors>
    <!-- 阿里云镜像 -->
    <mirror>
    <id>aliyun</id>
    <name>aliyun</name>
    <mirrorOf>central</mirrorOf>
    <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
    </mirrors>

    <!-- 指定jdk版本 -->
    <profiles>
    <profile>
    <id>jdk8</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>8</jdk>
    </activation>
    <properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <maven.compiler.compilerVersion>8</maven.compiler.compilerVersion>
    </properties>
    </profile>

    </profiles>

    </settings>

tomcat

  1. 下载tomcat 压缩包
    ,解压缩重命名为 tomcat
  2. 新建环境变量TOMCAT_HOME,值为 Tomcat 所在的目录,例如 D:\soft\tomcat
  3. 新建 CATALINA_HOMECATALINA_BASE, 值都设为%TOMCAT_HOME%
  4. 打开 PATH,在最后面添加变量值:;%CATALINA_HOME%\lib;%CATALINA_HOME%\bin

idea

  1. 下载idea 安装包
    破解包

  2. 安装 idea,解压破解包到 idea 安装目录

  3. 将以下内容添加到 idea 安装目录下的idea64.exe.vmoptions中,-javaagentja-netfilter.jar 路径根据自己的实际路径填写

    1
    2
    3
    -javaagent:D:\soft\IntelliJ IDEA 2023.2.2\jetbra\ja-netfilter.jar=jetbrains
    --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
    --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED
  4. 该网站获取激活码,填写到 Activation code中,激活成功

不用关心激活时间,它是后备许可证,不会过期

其他软件

ffmpeg

  1. 下载压缩包,解压缩后重命名为 ffmpeg
  2. 打开PATH,在最后面添加环境变量值: ;D:\soft\ffmpeg\bin

yt-dlp

  1. 下载exe 执行文件,新建D:\soft\yt-dlp
    目录,将 yt-dlp.exe移动到该目录
  2. 打开PATH,在最后面添加环境变量值: ;D:\soft\yt-dlp

windows环境配置
https://blog.jaychou.site/2023/12/02/windows环境配置/
作者
Nichuanfang
发布于
2023年12月2日
更新于
2023年12月27日
许可协议