Pages

Wednesday, March 12, 2014

How to Install MongoDB on windows



To install MongoDB we don`t have to run ant exe file.All we have to do is download the zip file from the official MongoDB website.Depending upon the OS download 32 or 64 bit version zip files.

Unzip it and place the folder in a location .For Ex:D:\mongodb

 How to start the MongoDB server 

  • Open a command prompt and navigate to the mongodb\bin  and issue the highlighted command.
  • MongoDB needs a data folder to flush the data .So we need to create the folder manually(any location For Ex: D:\mongodb\data\db ) .Refer the screenshot for any doubts.

mongod --dbpath "D:\mongodb\data\db"

  • Once the server starts successfully the cursor starts blinking at the end .

Connect to MongoDB

  • Open another command prompt without closing the first command prompt(as this will close the server).
  • Navigate to the bin folder of the mongodb folder and issue the command as shown in the below screenshot.
mongo


Instead of navigating each and every time to the installation location you can set in the PATH varaible to execute it from any location.

Unable to install Maven: “JAVA_HOME is set to an invalid directory”

Sometimes when we try to run mvn -version command it gives the following error in the command prompt .

Solution:

ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_51\bin" .Please set the JAVA_HOME variable in your environment to match the location of your Java installation

JAVA_HOME should be set to C:\Program Files\Java\jdk1.7.0_51.  PATH should be set to include %JAVA_HOME%\bin.

Hope this helps.:)

Tuesday, March 11, 2014

How to install maven on Windows




  • For installing maven we don`t have to run any exe(executable) file.All we need is to download the zip file , unzip and edit the PATH in environment variables.
  • Before you start the installation make sure java is installed in the system and JAVA_HOME system variable is set in System variables as below.

  • Download the zip file from Official Maven website.Depending on whether your system is 32 bit or  64bit you can download the zip file.for Ex:(apache-maven-3.2.1-bin.zip ).I have unzipped at c:\apache-maven-3.0.5 and set the system variable  as  shown  in the screen shot below.


  • Also edit  the system variable Path/PATH  so that it has your maven location as the below screenshot so that you can execute maven from any directory.







  • Test the installed maven by issuing the command mvn -version.The output should be as follows.That means Maven has been successfully  installed on your computer.



While testing sometimes you may encounter error :Unable to install Maven: “JAVA_HOME is set to an invalid directory.To solve this,you can go to following link .