java配置

JAVA_HOME
C:\Program Files\Java\jdk1.8.0_144
CLASSPATH
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
编辑:path
%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;


maven:
MAVEN_HOME,并将变量值设置为安装路径,在这里为D:\apache-maven-3.3.9


在“系统变量(S)”中,选中“Path变量”,在其变量值的末尾加上%MAVEN_HOME%\bin(注意:跟前面变量值要以英文分号间隔)。






如果你的Tomcat安装在C盘里,如:C:\apache-tomcat-7.0.22(在这里切记一下,安装Tomcat时,在其字母周围一定不要存在空格,否则最后可能导致配置不成功)
同样,在系统变量里点新建:
       变量名:CATALINA_BASE
       变量值:C:\apache-tomcat-7.0.22;
       再次新建:
       变量名:CATALINA_HOME
       变量值:C:\apache-tomcat-7.0.22;
       点击确定后在classpath中加入%CATALINA_HOME%\common\lib\servlet-api.jar;
       在path中加入%CATALINA_HOME%\lib;
       
       
       
       maven:
       
       
       一、下载


http://maven.apache.org/download.cgi


也可以直接在eclipse工具中下载,点击eclipse菜单栏Help->Eclipse Marketplace搜索关键字maven到插件Maven Integration for Eclipse 并点击安装即可


架构Maven工作环境(配置环境变量)
新建:MAVEN_HOME
路径(例如):D:\360Downloads\tools\marven3.5\apache-maven-3.5.0
添加到path配置文件中:;%MAVEN_HOME%\bin;


二、配置好后验证


输入mvn -version








打开settings.xml,修改如下2个地方的内容:


1、此处为存放下载依赖存放地方,在文件第53行:


原始文件:


<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
修改后的文件:


<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>D:\eee\1701javaee_2\maveninport_aliyun\.m2\repository</localRepository>
 
2、此处为修改为从阿里云服务器上下载依赖,强烈建议更换,下载速度会快很多,在文件第160行


原始文件:


<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
</mirrors>
修改后的文件:


<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<!-- 阿里云镜像 下载配置 -->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>


</mirrors>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值