[配置] 开发环境配置
一、Windows
开发环境配置
1、JDK
环境变量配置
JAVA_HOME
C:\Program Files\Java\jdk1.8.0_181
CLASSPATH
.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
path
%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
验证是否安装成功
C:\Users\Davidbieber> java
C:\Users\Davidbieber> javac
2、Mysql
配置
MYSQL_HOME
C:\Program Files (x86)\MySQL\MySQL Server 5.5
path
%MYSQL_HOME%\bin
验证是否安装成功
C:\Users\Davidbieber> mysql -uroot -p
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.5.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
3、Maven
配置
setting.xml
配置
<!--设置maven镜像地址-->
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<!--设置默认JDK版本-->
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
<!--设置maven本地仓库-->
<localRepository>D:\MavenRepository</localRepository>
MAVEN_HOME
D:\apache-maven-3.5.4
path
%MAVEN_HOME%\bin
验证是否安装成功
C:\Users\Davidbieber> mvn -v
二、Mac
开发环境配置
1、.bash_profile
配置
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPATH
export PATH=/usr/local/mysql/bin:$PATH
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
三、通用环境配置
1、npm
配置
npm
插件安装路径与缓存路径更改
//全局安装路径
npm config set prefix "ABSOLUTE_PATH"`
//全局缓存路径
npm config set cache "ABSOLUTE_PATH"`
npm
插件安装路径与缓存路径验证
//验证全局安装路径
npm config get prefix
//验证全局缓存路径
npm config get cache
npm
版本查询
npm -v
2、node
配置
node
版本验证
node -v
3、webpack
配置
webpack
版本验证
webpack -v
4、Vue.js
配置
vue
版本验证
vue -V