Thursday, November 21, 2013

Setting up your Linux Environment (Ubuntu) for JAVA Development

This tutorial is for starters. although this may also help professionals. I am using Ubuntu 12.04 LTS and I thought of creating a tutorial on how to setup your Linux environment for java development.

Installing JDK 6

  • download jdk from here
  • create folder jvm in /usr/local
  • move the downloaded jdk to /usr/local/jvm
  • change the permission of jdk -> sudo chmod 700 jdk-6u38-linux-i586-rpm.bin
  • extract jdk using command -> ./jdk-6u38-linux-i586-rpm.bin
  • create a link for the jdk -> ln -s jdk-6u38 java
  • add the jdk in your enviromnent PATH. I usually add it in .bashrc
          you can add the following in your .bashrc:

          export JAVA_HOME=/usr/local/jvm/java
          export JDK_HOME=$JAVA_HOME
          export PATH=$PATH:$JAVA_HOME/bin

Installing JDK 7

Just execute the following commands to install jdk7
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Installing Subversion

sudo apt-get install subversion

Installing Git

sudo apt-get install git-core

Installing Maven

  • Go to Apache Maven website and follow the instructions
  • place maven in /usr/local/apache-maven
  • if you have your own settings.xml, create .m2 folder in your home directory and place your settings.xml
  • add maven in your environment path