Java环境搭建

JDK下载地址:https://www.azul.com/downloads

Mac搭建开发环境 - 图1

Mac搭建开发环境 - 图2

Mac电脑无需配置 PATH 和 JAVA_HOME

HomeBrew安装参考地址:https://blog.csdn.net/weixin_45626288/article/details/128125978

Python环境搭建

https://dandelioncloud.cn/article/details/1584769546592702466

Tomcat环境搭建

https://blog.csdn.net/weixin_41317840/article/details/130011135

  1. chenjia@chentonndiannao ~ % brew search tomcat
  2. ==> Formulae
  3. tomcat tomcat@7 tomcat@9
  4. tomcat-native tomcat@8 touca
  5. ==> Casks
  6. topcat
  7. chenjia@chentonndiannao ~ % brew install tomcat@8
  8. //设置环境变量
  9. echo 'export PATH="/opt/homebrew/opt/tomcat@8/bin:$PATH"' >> ~/.zshrc
  10. //后台启动tomcat服务
  11. brew services start tomcat@8
  12. //关闭后台tomcat服务
  13. brew services stop tomcat@8
  14. //如果不需要后台运行,可以直接运行下面命令启动
  15. /opt/homebrew/opt/tomcat@8/bin/catalina run
  16. 或者(配置过环境变量后使用)
  17. catalina run

启动后,在浏览器访问:http://localhost:8080/

如果能看到tomcat页面即安装成功了。

Maven环境搭建

  1. 官网下载安装包

Mac搭建开发环境 - 图3解压放到自己存放软件的位置进行环境配置

  1. 打开终端,vim ~/.zshrc,配置环境变量,之后source ~/.zshrc
  1. export M2_HOME=/Users/chenjia/username/SoftWare/Develop/apache-maven-3.9.3
  2. export PATH=$PATH:$M2_HOME/bin
  1. 验证mvn -v,出现以下界面,安装成功;
  2. 更换Maven下载源
  1. <localRepository>/Users/chenjia/ChenJia/SoftWare/DevelopFile/MavenRepository</localRepository>
  1. 更换Maven仓库存放路径
  1. <mirror>
  2. <id>aliyunmaven</id>
  3. <mirrorOf>central</mirrorOf>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public</url>
  6. </mirror>

Node环境搭建

https://blog.csdn.net/weixin_41793990/article/details/128833394

MySQL环境搭建

https://blog.csdn.net/weixin_44719880/article/details/129327320

Redis环境搭建

https://blog.51cto.com/u_16099306/6573853

  1. Last login: Sun Jul 16 17:09:34 on ttys000
  2. chenjia@chentonndiannao ~ % brew search node
  3. ==> Formulae
  4. libbitcoin-node node-build node@16 nodeenv
  5. linode-cli node-sass node@18 nodenv
  6. llnode node@10 node_exporter ode
  7. node node@14 nodebrew
  8. ==> Casks
  9. capslocknodelay nodebox nodeclipse
  10. If you meant "node" specifically:
  11. It was migrated from homebrew/cask to homebrew/core.
  12. chenjia@chentonndiannao ~ % node -v
  13. v18.16.1
  14. chenjia@chentonndiannao ~ % uname -a
  15. Darwin chentonndiannao.domain.name 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
  16. chenjia@chentonndiannao ~ % brew search redis
  17. ==> Formulae
  18. hiredis redis redis@3.2 redis@6.2 redo
  19. iredis redis-leveldb redis@4.0 redir
  20. ==> Casks
  21. another-redis-desktop-manager redis-pro
  22. jpadilla-redis redisinsight
  23. medis
  24. chenjia@chentonndiannao ~ % cls
  25. zsh: command not found: cls
  26. chenjia@chentonndiannao ~ % cls
  27. zsh: command not found: cls
  28. chenjia@chentonndiannao ~ % clear
  29. chenjia@chentonndiannao ~ % brew install redis
  30. ==> Fetching dependencies for redis: ca-certificates and openssl@3
  31. ==> Fetching ca-certificates
  32. ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ca-certificates-202
  33. ######################################################################### 100.0%
  34. ==> Fetching openssl@3
  35. ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/openssl%403-3.1.1_1
  36. ######################################################################### 100.0%
  37. ==> Fetching redis
  38. ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/redis-7.0.12.arm64_
  39. ######################################################################### 100.0%
  40. ==> Installing dependencies for redis: ca-certificates and openssl@3
  41. ==> Installing redis dependency: ca-certificates
  42. ==> Pouring ca-certificates-2023-05-30.arm64_ventura.bottle.tar.gz
  43. ==> Regenerating CA certificate bundle from keychain, this may take a while...
  44. 🍺 /opt/homebrew/Cellar/ca-certificates/2023-05-30: 3 files, 216.2KB
  45. ==> Installing redis dependency: openssl@3
  46. ==> Pouring openssl@3-3.1.1_1.arm64_ventura.bottle.tar.gz
  47. 🍺 /opt/homebrew/Cellar/openssl@3/3.1.1_1: 6,495 files, 28.4MB
  48. ==> Installing redis
  49. ==> Pouring redis-7.0.12.arm64_ventura.bottle.tar.gz
  50. ==> Caveats
  51. To start redis now and restart at login:
  52. brew services start redis
  53. Or, if you don't want/need a background service you can just run:
  54. /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
  55. ==> Summary
  56. 🍺 /opt/homebrew/Cellar/redis/7.0.12: 14 files, 2.7MB
  57. ==> Running `brew cleanup redis`...
  58. Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
  59. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
  60. ==> Caveats
  61. ==> redis
  62. To start redis now and restart at login:
  63. brew services start redis
  64. Or, if you don't want/need a background service you can just run:
  65. /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
  66. chenjia@chentonndiannao ~ %
  1. # 启动redis
  2. brew services start redis
  3. # 关闭redis服务
  4. brew services stop redis
  5. /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf