標籤:maven jdk java開發環境
1. 先安裝oracle11G,它會自動在環境變數中加入oracle所使用的jdk的配置.
2. 安裝好jdk,再進行Jdk配置,確保jdk7的環境變數配置一定要在 oracle的配置之前。
將jdk與jre都安裝到預設的路徑下,再進行環境變數配置
JAVA_HOME: jdk路徑
PATH: %JAVA_HOME%\bin; %JAVA_HOME%\jre\bin;
CLASSPATH: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
完成後,請在控制台中測試: java –version
Javac -version
3. Android配置
將Android ADT bundle解壓到d:\ 目錄下.再進行配置:
ANDROID_HOME: D:\adt-bundle-windows-x86-20140702;
PATH: %ANDROID_HOME%\sdk\tools;%ANDROID_HOME%\sdk\platform-tools;
以下配置用來修改avd檔案的位置
ANDROID_SDK_HOME: d:\android\avd
4. Maven配置
(1)環境變數
MAVEN_HOME : D:\apache-maven-3.3.1
MAVEN : %MAVEN_HOME%\bin
(可選) MAVEN_OPTS : -Xms256m-Xmx512m
PATH: %MAVEN%;
(2)maven設定檔settings.xml 請拷貝一份到D:\apache-maven-3.3.1\conf,替換原來的settings.xml( 這份新的中主要是增加了私服的配置,請注意私服的ip地址,請根據私服的具體位置修改)
用nexus代理Maven的中央倉庫,setting.xml的設定檔修改內容如下:
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>Nexus Mirror</name>
<url>http://私服地址:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
Java、android開發環境變數的配置