Wednesday, January 11, 2017

Installing Java in Ubuntu

Installing Java in ubuntu


In order to install Java 6,7,8 that are not available in Ubuntu 16.04 default directory follow the below steps

First, add Oracle's PPA, then update your package repository.

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update


Oracle JDK 6

To install Jdk 6 use the following command

$ sudo apt-get install oracle-java6-installer


Oracle JDK 7

To install Jdk 7 use the following command


$ sudo apt-get install oracle-java7-installer


Oracle JDK 8

This is the latest stable version of java. To install Jdk 8  use the following command

$ sudo apt-get install oracle-java8-installer

Wednesday, January 27, 2016

Install Maven in UNIX systems

Install Maven in UNIX systems

Download Apache Maven from the following link

https://maven.apache.org/download.cgi


  • Open Terminal (Command + Space and type Terminal)
  • Open .bash_profile file in vim editor.
    • Type command    vim ~/.bash_profile
    • If file is not present create it in home folder with 
      • touch .bash_profile
    • Press 'i' to edit .bash_profile.
  • Type the following in .bash_profile
    • export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk_version}/Contents/Home
    • export M2_HOME=/Downloads/apache-maven-3.*.*/
    • export PATH=$PATH:$M2_HOME/bin
    • alias mvn='$M2_HOME/bin/mvn'
  • Press Esc to exit editing and type :wq to  write and exit
  • Compile file for changes
    • source .bash_profile
  • To check whether the maven is configured properly use 
    • mvn -version
  • Your result must be something like this
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T22:11:47+05:30)
Maven home: /Users/skhatri/Downloads/apache-maven-3.3.9
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"