Blogger Information
Blog 3
fans 1
comment 0
visits 5095
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
001 JavaSE阶段安装jdk
Sunday灬燃的博客
Original
456 people have browsed it

在Windows上安装Java

  1. // 去【[官网下载](https://www.oracle.com/java/technologies/javase-downloads.html)】Windows 64位的软件包
  2. // 配置 JAVA_HOME
  3. JAVA_HOME = "安装地址"
  4. // 在path中配置JAVA_HOME
  5. %JAVA_HOME%\bin
  6. //测试
  7. java --version

在Mac m1 上安装java

  1. // 去【[官网下载](https://www.oracle.com/java/technologies/javase-downloads.html)】专属Mac m1的软件包
  2. // 在多个版本间进行切换
  3. // 1.创建.bash_profile文件
  4. vim ~/.bash_profile
  5. // 2.添加JDK的环境变量
  6. export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home
  7. export JAVA_11_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
  8. export JAVA_15_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home
  9. // 3.默认JDK1.8
  10. export JAVA_HOME=$JAVA_8_HOME
  11. // 4.alias命令动态切换JDK版本
  12. alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
  13. alias jdk11="export JAVA_HOME=$JAVA_11_HOME"
  14. alias jdk15="export JAVA_HOME=$JAVA_15_HOME"
  15. PATH=$PATH:/usr/local/bin/
  16. // 5.保存文件
  17. :wq
  18. // 6.立即生效
  19. source ~/.bash_profile
  20. // 7.测试可以先输入,查看当前版本
  21. java --version
  22. // 然后分别输入如下代码看是否切换成功
  23. java15
  24. java --version
  25. java11
  26. java --version
  27. java8
  28. java --version
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post