Setting Apache Maven classpath in Windows:
Before development in Maven we need to set the following classpath JAVA_HOME, MAVEN_HOME, PATH.
Step 1:
Start button -> My Computer-> Right Click-> Properties -> Advanced System Settings -> Advanced tab in System Properties dialog -> Environment Variables button -> System variables
Step 2:
Click on the "New" button to add environment variables.
Step 3:
Set the JAVA_HOME variable.
It should point to the JDK path just above the "bin" directory like shown below.
Step 4:
Set the M2_HOME variable.
It should point to the directory one level above the "bin" directory.
Step 5:
Set M2 variable.
Step 6:
Set the Path variable.
You may already have a variable with the name "Path".
Search for it in the list of variables.
If you don't see a path variable then hit the "New" button and create a new variable like below.
Add this at the end of the text after a semicolon (;)
%M2%;%JAVA_HOME%
Step 7:
Open a command prompt by going to the Start Menu and typing in "cmd". Hit Enter.
Step 8:
Type the command "mvn -version" and hit enter.
If you have done all the above steps correctly then you will be able to see something like this.
Congratulations...!! Now you have successfully set the Maven path.
Before development in Maven we need to set the following classpath JAVA_HOME, MAVEN_HOME, PATH.
Step 1:
Start button -> My Computer-> Right Click-> Properties -> Advanced System Settings -> Advanced tab in System Properties dialog -> Environment Variables button -> System variables
Step 2:
Click on the "New" button to add environment variables.
Step 3:
Set the JAVA_HOME variable.
It should point to the JDK path just above the "bin" directory like shown below.
Step 4:
Set the M2_HOME variable.
It should point to the directory one level above the "bin" directory.
Step 5:
Set M2 variable.
Step 6:
Set the Path variable.
You may already have a variable with the name "Path".
Search for it in the list of variables.
If you don't see a path variable then hit the "New" button and create a new variable like below.
Add this at the end of the text after a semicolon (;)
%M2%;%JAVA_HOME%
Step 7:
Open a command prompt by going to the Start Menu and typing in "cmd". Hit Enter.
Step 8:
Type the command "mvn -version" and hit enter.
If you have done all the above steps correctly then you will be able to see something like this.
Congratulations...!! Now you have successfully set the Maven path.
No comments:
Post a Comment