Install Java and Enable it for Web Browsers | Linux

(Steps based on what I did in Ubuntu OS)

As you know Java is essential to be installed and should be enabled to web browsers on local machines from where the system admins access their servers. The need of Java in most cases while we access consoles like KVM switches, IPMI etc to reboot a server which is down or to check what’s happening inside the server when SSH and network is down. In such cases, Java applet programs from the server would access our local machines and needs Java present in our machine inorder to run to work with web browser.

The local machines without Java installed or Webbrowsers not enabled with Java plugins will pop up errors like as follows when you load KVM or IPMI pages:






Following are the steps to install Java and enable it for Mozilla-firefox and Chromium Web Browsers in Ubuntu OS.


1) Go here >>

Download Java source, looks like “jre-7u51-linux-x64.tar.gz”. Note to choose source package based on your machines architecture 32bit or 64bit(Run ‘arch’ or ‘uname -m’ to check it)

2) Once downloaded, move the source package to path /usr/local/java. If folder doesn’t exist create one “mkdir /usr/local/java”

(Make sure you have the power to run all commands using sudo if you are a normal user, else be logged in as root)

#mv /home/john/Downloads/jre-7u51-linux-x64.tar.gz /usr/local/java/

#cd /usr/local/java/

#tar xvf jre-7u51-linux-x64.tar.gz

(You will see it untarred and everything in a folder named ‘jre1.7.0_51’)

#chown root.root /usr/local/java/ -R

3) Now open the file “/etc/profile” and add the following on top

export JRE_HOME
export PATH

4) Now run the below commands to let OS know the path where Java JRE is located and set.

#update-alternatives –install “/usr/bin/java” “java” “/usr/local/java/jre1.7.0_51/bin/java” 1

#update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/local/java/jre1.7.0_51/bin/javaws” 1

#update-alternatives –set java /usr/local/java/jre1.7.0_51/bin/java

#update-alternatives –set javaws /usr/local/java/jre1.7.0_51/bin/javaws

5) Reload your system wide PATH /etc/profile by typing the following command:

# . /etc/profile

(Sometimes you may need to reboot your ubuntu system to reload the system wide PATH in /etc/profile)

Now Java is installed, check the version by using “java -version”

For Chromium

# cd /usr/lib/chromium-browser/plugins/
# ln -s /usr/local/java/jre1.7.0_51/lib/amd64/
# root@vaiocyber:/usr/lib/chromium-browser/plugins# ll
total 8
drwxr-xr-x 2 root root 4096 Mar 30 12:48 ./
drwxr-xr-x 7 root root 4096 Mar 17 03:14 ../
lrwxrwxrwx 1 root root 49 Mar 30 12:48 -> /usr/local/java/jre1.7.0_51/lib/amd64/*

Exit and reload Chromium browser now and load the KVM or IPMI page successfully 🙂
For enabling Java plugin permanently, in the address bar type “about:plugins” or “chrome://plugins/” . Choose “Java(TM) – Version: 10.x.x”
from the plugins list and check “Always allowed”.


For Mozilla Firefox

# cd /usr/lib/mozilla/plugins
# ln -s /usr/local/java/jre1.7.0_51/lib/amd64/
root@vaiocyber:/usr/lib/mozilla/plugins# ll
total 372
drwxr-xr-x 2 root root 4096 Mar 30 12:50 ./
drwxr-xr-x 4 root root 4096 Oct 17 00:31 ../
lrwxrwxrwx 1 root root 37 Mar 2 08:06 -> /etc/alternatives/mozilla-flashplugin
lrwxrwxrwx 1 root root 49 Mar 30 12:50 -> /usr/local/java/jre1.7.0_51/lib/amd64/*
-rw-r–r– 1 root root 6088 May 16 2013
-rw-r–r– 1 root root 100720 May 26 2013
-rw-r–r– 1 root root 105440 May 26 2013
-rw-r–r– 1 root root 72048 May 26 2013
-rw-r–r– 1 root root 80576 May 26 2013

Exit and reload Firefox now and load the KVM or IPMI page successfully 🙂
For enabling Java plugin permanently, click on Tools menu >> Add-ons, select “plugins” tab and set Java plugin “Always Active”.


Login fails to Roundcube, Horde, Squirrel in Webmail

Do the solution steps as mentioned here for the following error you see in Roundcube, Horde and Squirrel mails after successfully logging in webmail.

Login failed because your username or password was entered incorrectly

#First check the domain name is there in files /etc/localdomains or /etc/remotedomains depends on its local or remote mail exchanger.

#Check the domain’s name is present in /etc/userdomains, if not run script /scripts/updateuserdomains

#Make sure the server hostname is not same as the name of problematic domain name, which would create unexpected authentication issues.
for eg: if your main domain name is then the hostname should not be the same main domain name, add a new subdomain entry like or etc

Finally you can make sure the entries in /etc/hosts are correct, especially the localhost associated with loop ip

A default hosts will look like as follows.


# cat /etc/hosts
# that require network functionality will fail.
# Do not remove the following line, or various programs        localhost server


((((replace with original server main IP and with original server hostname))))

After correcting all the above, you will be able to login into Roundcube, Horde, Squirrel successfully.