Showing posts with label Eclipse IDE. Show all posts
Showing posts with label Eclipse IDE. Show all posts

Sunday, July 1, 2012

Apache Maven - Setting up

What is Apache Maven?

In simple words Maven is a build automation tool for Java projects. 
There are many things which can be written for maven but to get more theoretical details  visit Apache Maven-Wikipedia page or can refer to the official Apache Maven website.


Setting-up Apache Maven:

Setup - Windows:

  1. First download the latest version maven form here. For this tutorial, I have downloaded maven-3.0.4.
  2. Unzip the downloaded apache-maven-3.0.4-bin.zip. In my case, unzipped it in C:\dev\maven3.0.4.
  3. Set a new environment variable M2_HOME pointing to the directory where maven is installed or  unzipped. In case if you don't know how to set an environment variable in windows, follow the link. 
  4. Set another environment variable M2 with value %M2_HOME%\bin. In the same way create/update the PATH variable with value %M2% so that Maven can be accessed from command line. 
  5. Check if the PATH variable also has the value of JAVA_HOME pointing to the installed jdk.
  6. Open command prompt (WinKey + R and type cmd) and execute the command mvn --version to see if its installed well.

Setup - Eclipse:


For this there is a plugin for Eclipse called M2E which can be used to launch Maven builds from within Eclipse and other stuff which maven can do.
Follow the steps given below to get M2E on eclipse:
  1. Open Eclipse.
  2. From the eclipse menu list, go to help -> Install New Software...
  3. Get maven from the update site "maven - http://download.eclipse.org/technology/m2e/releases".
    • Add the maven update site and get the list of plugins provided by it.
    • Select the plugin Maven Integration for Eclipse and press next and next.
    • Read and accept the terms of license agreement and press finish.


    • Restart eclipse.

More on Maven:

Feel free to share your experience/issues. 

Tuesday, June 26, 2012

Python in Eclipse [PyDev plugin for Eclipse]

While learning python, one question I had was, which python IDE to use? There are many options but being a Java developer I wanted to have something like Eclipse and it turned out that there is a plugin for eclipse which can be used for Python development with the auto-suggest, run, debug and many other features.

The plugin for eclipse is called PyDev and it's very easy to configure. 
Note: I work on a windows machine, so all the instructions are around a windows machine. 
  • Get Python:
    • Download the recent version of python from python.org.
    • Run the setup file (python-.msc) and follow the install insrtuction. 
    • Once the installation is complete, set the windows environment variable to point to the python installation folder.
      • Right click on "My Computer".
      • Select "properties". 
      • Click on the button "Environment Variables" under the tab "Advanced".


      • Add the path of python installation to the PATH variable, in my case its "D:\Python27\".


    • Go to dos command line and type the command ">python", if it takes you to the python command line, then it works.


  • Get Eclipse and install the PyDev plugin.
    • Download a version of Eclipse IDE from here do the setup you need for other dev. 
    • Now from Eclipse menu go to Help -> Install New Software. 
    • Add the PyDev update site http://pydev.org/updates.


    • Install the plugin. 
  • Configuration of Eclipse. 
    • From eclipse menu, open Window -> Preferences.
    • Look for PyDev -> Interepreter - Python.
    • Click on new and add the python.exe.
      • For windows, it was under the python installation i.e. d:\python27.
      • For linux, find it by running the command >which python






And all done, you are good to go... Play with python in eclipse.


Also check out my new post on Python-pip tool.