前言

总结来自刚入职时写的文档,当时也是东拼西凑,东搜细搜。为了方便回顾,特此记录于此。

安装JDK

由于国内的访问或通过公司网络访问oracle 官网的jdk 简直太卡了,因此可通过阿里云或华为的托管的软件来访问。

阿里云托管信息

jdk-11.0.7_linux-x64_bin.tar.gz https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-11.0.7_linux-x64_bin.tar.gz
jdk-11.0.7_osx-x64_bin.tar.gz https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-11.0.7_osx-x64_bin.tar.gz
jdk-11.0.7_windows-x64_bin.zip https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-11.0.7_windows-x64_bin.zip
jdk-8u251-linux-x64.tar.gz https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-8u251-linux-x64.tar.gz
jdk-8u251-macosx-x64.dmg https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-8u251-macosx-x64.dmg
jdk-8u251-windows-x64.exe https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-8u251-windows-x64.exe

华为托管信息

华为:https://repo.huaweicloud.com/java/jdk/
当前选择JDK-8u251-maxosx-x64.dmg, 下载完成后,直接安装。

环境变量配置

在当前用户的工作目录,查看是否存在 .bash_profile文件,没有的话则执行:
vim .bash_profile
代码块
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
验证安装
代码块
➜ ~ java -version
java version “1.8.0_251”
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

安装Maven

访问:https://maven.apache.org/download.cgi
下载最新的版本,当前下载的版本为:
image.png

配置环境变量

vim .bash_profile
代码块
export MVN_HOME=/Users/xiele/Tools/apache-maven-3.6.3
export PATH=$PATH:$MVN_HOME/bin
验证安装是否生效
代码块
➜ ~ mvn -verison
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/xiele/Tools/apache-maven-3.6.3
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “mac os x”, version: “10.15.4”, arch: “x86_64”, family: “mac”

安装IDEA

选择合适的版本

访问地址:https://www.jetbrains.com/idea/download/other.html
由于激活的缘故,当前下载的版本为:2020.1
image.png

激活

当前通过组内同学提供的激活码无法激活IDEA,选用的激活方案为使用jetbrain-ageng.jar的方式.(语雀不允许上传Jar文件,所以放到个人的百度网盘里)
操作方式为:解压后,拖入jetbrains-agent.jar到IDEA中,然后重启即可。

安装GIT

访问:https://git-scm.com/download/mac
下载 Binary installer

安装SublimeText3

说明:公司的WI-FI简直太慢了,建议回家连自己家的网络
http://www.sublimetext.com/3

安装Alfred

http://www.alfredapp.com/

安装iterm2

https://www.iterm2.com/
http://www.yangzhiping.com/tech/iterm2.html
通过官方网站下载,实在是太卡了,可通过三方软件中心下载,方案为:Google一下。

配色

切换bash: chsh -s /bin/zsh (切回去: chsh -s /bin/bash)
安装oh-my-zsh
代码块

curl 安装方式

sh -c “$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)”

出现的问题

iterm2 切换到zsh后,出现一个提示:
代码块
[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of “group” and “others” and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh] compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn’t help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] “true” before oh-my-zsh is sourced in your zshrc file.
解决方案:
修改.zshrc文件,在最开头添加一个变量:ZSH_DISABLE_COMPFIX=’true’ (在加载oh-my-zsh文件之前才行)
代码块
➜ ~ cat .zshrc
ZSH_DISABLE_COMPFIX=”true”
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

Path to your oh-my-zsh installation.
export ZSH=”/Users/xiele/.oh-my-zsh”

Set name of the theme to load —- if set to “random”, it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME=”robbyrussell”

Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( “robbyrussell” “agnoster” )

Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE=”true”

Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE=”true”

Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE=”true”

Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT=”true”

Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS=”true”

Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE=”true”

Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION=”true”

Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS=”true”

Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY=”true”

Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# “mm/dd/yyyy”|”dd.mm.yyyy”|”yyyy-mm-dd”
# or set a custom format using the strftime function format specifications,
# see ‘man strftime’ for details.
# HIST_STAMPS=”mm/dd/yyyy”

Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

source $ZSH/oh-my-zsh.sh

User configuration

export MANPATH=”/usr/local/man:$MANPATH”

You may need to manually set your language environment
# export LANG=en_US.UTF-8

Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR=’vim’
# else
# export EDITOR=’mvim’
# fi

Compilation flags
# export ARCHFLAGS=”-arch x86_64”

Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run alias.
#
# Example aliases
# alias zshconfig=”mate ~/.zshrc”
# alias ohmyzsh=”mate ~/.oh-my-zsh”