Skip to main content

INSTALLING JAVA IN UBUNTU



This post explains how to install Java in Ubuntu. You can install Iced tea java (open source) or the Oracle java. Installing Iced tea java is simple where as to install Oracle java you have to struggle a little with the command line.
Let's get started. First I'll tell you how to install iced tea java and then we'll see how to install oracle java.

1. INSTALLING ICED TEA JAVA:

Open a terminal by pressing CTRL + ALT + T keys or by searching for “terminal” in dash. Type the following to installed iced tea java on your machine.

sudo apt-get install openjdk-7-jre icedtea-plugin


That should install the java run time environment and the plugin for your browser.

2. INSTALLING ORACLE JAVA:



To install oracle java you should first download the 32bit or 64bit Linux "compressed binary file" - it has a ".tar.gz" file extension. Now we need to uncompress the file. Right click on the file and select “extract here”. OR you can do it the terminal way:

tar -xvf jre-7-linux-i586.tar.gz

The package is now extracted into a folder. Now move the folder to
/usr/lib.

       
sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0




After that run the following to get a list of currently installed java alternatives:

       
sudo update-alternatives --config java


You will get the output as something like this:
       
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice[*], or type selection number:





Now type the following in the terminal:

       
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 3






This will add your new java installation into alternatives list.
Now configure java to use oracle JRE:

       
sudo update-alternatives --config java





You will see output similar to the one below:

       
There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jre1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.


If there was no previous java installation then the new JRE will be the default and you will see output as:

       
There is only one alternative in link group java: /usr/lib/jvm/jre1.7.0/bin/java

Nothing to configure.




Check the version of your new java installation by typing the following in terminal:

       
java -version






It should produce an output similar to the one below:

       
java version "1.7.0_25"

Java(TM) SE Runtime Environment (build 1.7.0_25-b15)

Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)




INSTALLING FIREFOX JAVA PLUGIN:

In a terminal :

       
mkdir ~/.mozilla/plugins







Now remove a former version of the Java plugin (may or may not be present)
       
rm ~/.mozilla/plugins/libnpjp2.so



Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located). For 32bit java use
       
ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/


For 64bit java use :

       
ln -s /usr/lib/jvm/jre1.7.0/lib/amd64/libnpjp2.so ~/.mozilla/plugins/





Finally, installation completed successfully!

Popular posts from this blog

INSTALLING MOBILE PARTNER IN LINUX

Most of you who have a Huawei USB modem (data card) might have tried to install mobile partner (dash board) in Linux. Here I will show you how to install mobile partner in Linux. First, you have to copy the folder called Linux in the data card. The files in the data card are not accessible from Linux so copy them from Windows. Now right click the file “install” in the “Linux” folder. Go to the permissions tab and select the check box beside Allow executing as a program. Now open a terminal by pressing CTRL + ALT + Tkeys. Change the working directory to the folder “Linux” by using “cd <path to folder>”. Now type ./install. If you had installed this software in your system before, you will get a prompt: "The software is exist, do you want overwrites? ([Y]/[N])", enter "y" to overwrites or "n" to exit. If you do not had installed this software in your system before, you will get a prompt: "Please input the install path[/usr/local/Mobile_Partner]:"…

How to install OpenVAS 7 in Ubuntu

OpenVAS is a framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution.

This is a guide for installing OpenVAS in Ubuntu. 

STEP 1:

First we need to prepare our system for installation of OpenVAS. Open a terminal and type the following command:

sudo apt-get install build-essential bison flex cmake pkg-config libglib2.0-0 libglib2.0-dev libgnutls26 libgnutls-dev libpcap0.8 libpcap0.8-dev libgpgme11 libgpgme11-dev doxygen libuuid1 uuid-dev sqlfairy xmltoman libsqlite3-0 libsqlite3-dev libxml2-dev libxslt1.1 libxslt1-dev xsltproc libmicrohttpd-dev libldap-2.4-2 libldap2-dev

STEP 2:

Now we need to download the OpenVAS source packages from the OpenVAS website. You can download it from the the website or you can use the terminal to download the files using the following commands:  

mkdir openvas-srccd openvas-src/wget http://wald.intevation.org/frs/download.php/1638/openvas-libraries-7.0.1.tar.gzwget http://wald.inteva…

How to setup a wifi-hotspot in Ubuntu: The terminal way.

Ubuntu has a "Use as hotspot" mode. But it creates a n ad-hoc network only.Wireless hotspots aren't same as ad hoc networks. Significant difference is there. In short, ad hoc networks aren't supported in most Android, Windows Phone and Blackberry devices (and may be iOS devices too) whereas AP mode Wi-Fi hotspots are.

              It is really simple and easy to setup a hotspot in Ubuntu. We use a tool called ap-hotspot. To install it open a terminal and type the following:

sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install ap-hotspot
             Next, to start the hotspot type the following in a terminal:
sudo ap-hotspot start
It asks you which adapter's internet you want to share, name of the network, password, etc. in an interactive manner. To stop the hotspot type the following n the terminal :
sudo ap-hotspot stop
To configure it type the following in the terminal :
sudo ap-hotspot configure