如何检查机器上安装的Java,Maven,Gradle,NodeJ的版本以及如何为所有这些构建工具或JDK设置环境变量?
答案 0 :(得分:3)
转到你的CMD(适用于Windows)或shell终端(适用于linux / ubuntu)
检查安装的Java版本和编译器版本:
C:\>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
您可以在这里查看编译器版本
C:\>javac -version
javac 1.7.0_71
检查安装了哪个版本的Maven:使用(mvn -v或mvn版本)
C:\>mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T22:59:23+05:30)
Maven home: C:\apache-maven-3.2.5
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_71\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
检查安装的Gradle版本:
C:\>gradle -version
------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------
Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a
Groovy: 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.7.0_71 (Oracle Corporation 24.71-b01)
OS: Windows 7 6.1 amd64
检查安装的节点版本:
C:\>node -v
v0.12.0
设置
的环境变量1)JAVA
Windows: Set the environment variable JAVA_HOME to C:\Program Files\Java\jdk1.6.0_21
Linux: export JAVA_HOME=/usr/local/java-current
2)Maven (在这里提取分布(你可以提取你想要的任何地方)
Windows: C:\Program Files\Apache Software Foundation\apache-maven-3.2.1
Linux: /usr/local/apache-maven
窗: -
M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-2.2.1
M2=%M2_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m
Linux中: 打开命令终端并设置环境变量。
export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=$M2_HOME/bin
export MAVEN_OPTS=-Xms256m -Xmx512m
3)