Installing Java-1.8 in Ubuntu 14.04

Here is the procedure on how to install java-1.8 version in ubuntu 14.04.

Initially check the java version that is available in your computer

  • java -version

Create an empty folder so that we can install java 1.8

  • sudo mkdir /opt/java && cd /opt/java

Now lets download java-1.8 version


  • wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""

Extract the tar file

  • tar -zxvf jdk-8u45-linux-x64.tar.gz

Now lets update the alternatives so that system will point to the location where java-1.8 is installed

  • cd jdk1.8.0_45/
  • sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_45/bin/java 100

Note: The 100 in above command represents the priority no.  which can set manually

  • sudo update-alternatives --config java

    Please enter the selection no. which is having the path as  “/opt/java/jdk1.8.0_45/bin/java” and press enter.

  • sudo update-alternatives –install /usr/bin/javac javac /opt/java/jdk1.8.0_45/bin/javac 100
  • sudo update-alternatives –config javac
  • sudo update-alternatives –install /usr/bin/jar jar /opt/java/jdk1.8.0_45/bin/jar 100
  • sudo update-alternatives –config jar

Now lets try to set up the environment variables

  • sudo nano /etc/environment
  • In this file change the Java home path


  • Add this line as new line in the file
  • update the path variable .In the path variable paste the following value instead of /usr/bin/java-7.....
  • So now your path variable will look like this
  • Restart the ennvironment file

source /etc/environment


Now let’s check whether the java is updated or not

  • java -version

java version “1.8.0_71”
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)

Python selenium tool to crawl any website.

Requirements :

Ubuntu (any latest version will be fine)

FIrst we will try to install selenium tool :-

  • sudo apt-get install python-pip
  • sudo pip install selenium
  • sudo pip install django==”1.6″


 Sample Program

# coding=utf-8
import time
from selenium import webdriver
import os

driver = webdriver.Firefox()


hText=”सुधीर Bhayya”
time.sleep(5) #waits till the translation gets done

translatedText = driver.find_element_by_id(“result_box”).text

print translatedText



 driver = webdriver.Firefox()
This statement will open a firefox  browser in your machine


opens in your browser.


enter some hindi language text in the box to convert it to english


clicks translate button to get the translate to english






Mysql Basics

MySQL Tutorial
Here are some instructions for mysql beginners:-

Installation of Mysql :-

1) sudo apt-get install mysql-server

Connecting to Mysql:-

Open a terminal and type

1) mysql -u root -p (for localhost i.e in same machine)

2) mysql -u root -p -h ##your-IP## (to coonnect mysql in different machines)

Some Basic Commands:-

1) create database Sample {for creating a database named ‘Sample’}

2) use Sample {for using the database ‘Sample’}

3) create table Employee (id integer,name varchar(50),location varchar(50)) ;
{creating a table ‘Employee’ with 3 columns ‘id’ –> integer type,’name’ –> String,’location’ –> String}

4) insert into Employee values(101,’john’,’Delhi’); {Inserts data in to Employee table }

5) select * from Employee; {Displays all the rows from Employee}

6) update Employee set id=’102′ where id =’101′; {Updates data in Employee from 101 to 102}

7) delete from Employee where id =’102′; {deletes a row in Employee where id is 102}

8) drop table Employee {deletes table Employee}

9) drop database Sample {deletes database Sample}