-3

How to check which version of Java, Maven, Gradle, NodeJs installed on your machine and how to set environment variables for all these building tools or JDK ?

PAA
  • 1
  • 46
  • 174
  • 282
  • These are very basic usage questions, for which you can very quickly find the answer in the documentation of the tools you're talking about. – Jesper Apr 16 '15 at 20:33
  • possible duplicate of [Getting version of java in runtime](http://stackoverflow.com/questions/2591083/getting-version-of-java-in-runtime) – Luke Apr 16 '15 at 20:52

1 Answers1

4

Goto your CMD (for Windows) or shell terminal (for linux / ubuntu)

To check which Java version and compiler version installed:

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)

Here you can check compiler version

C:\>javac -version
    javac 1.7.0_71

To check which version of Maven installed: Use(mvn -v or mvn version)

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"

To check which version of Gradle installed:

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

To check which version of node installed:

C:\>node -v

v0.12.0

Setting environment variables for

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 (extract distribution here (You can extract any where you want)

Windows:  C:\Program Files\Apache Software Foundation\apache-maven-3.2.1
Linux: /usr/local/apache-maven

Windows:-

M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-2.2.1
M2=%M2_HOME%\bin
MAVEN_OPTS=-Xms256m -Xmx512m

Linux: Open command terminal and set environment variables.

export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=$M2_HOME/bin
export MAVEN_OPTS=-Xms256m -Xmx512m

3)

PAA
  • 1
  • 46
  • 174
  • 282