Friday, May 18, 2012

Install the GNOME desktop in Ubuntu


  1. Type sudo apt-get  install ubuntu-desktop to download and install.
  2. Type startx to start the GNOME






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

How to release a service running on some port and assign new task in Ubuntu?

I have been running some service on my port 8080 and then tried to install Apache Tomcat server on the same port. It doesn't show me any output related to new installation when checked in the URL http://localhost:8080/ . The service that is already running on my 8080 port is not at all necessary for me. So I decided to kill it. Below are the steps.

1) Check the Process ID (PID) of the unwanted service running on 8080 by issuing the following command.


sudo fuser -n tcp 8080


2) It replies the PID of the service if it is running currently.

For example : 8080/tcp: 3660 in my case
Kill it by issuing the following command.


sudo kill 3660

3) Now assign your new service i.e Apache Tomcat server restart in my case. Thats it! It works ! :)



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

No JDK found - please set JAVA_HOME error while starting Apache tomcat in ubuntu

If you have already installed JDK and JRE in your system and encountered this error, then follow below steps.

1) Type sudo gedit ~/.bashrc in the terminal
2) Add export JAVA_HOME=/usr/lib/jvm/java-7-oracle  at the end of the file.  Here the path may vary depending upon your installation.  Open /usr/lib/jvm and check for the folder name and replace accordingly.  It is java-7-oracle in my case. This is nothing but setting up environmental path for java.


Check out if your Apache tomcat is starting.  If the same error encounters again, goto next step

3) Type sudo gedit /etc/default/tomcat6  in the terminal and hit enter.
( Type password if asked ).
4) Search for the word something similar to this JAVA_HOME=/usr/lib/jvm/java-7-oracle
If this line is commented, uncomment it and give the same path which you have given previously in .bashrc file.
5) Save the file and try to start the server again. It works!



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

How to install Tomcat in Ubuntu ?


1) Find a correct tomcat package to install



sudo apt-cache search tomcat

2) For example, if you find tomcat6 in the output of above command, Install all Tomcat packages with following commands

sudo apt-get install tomcat6-webapps
sudo apt-get install tomcat6-admin
sudo apt-get install tomcat6

3) In order to start your Apache tomcat server, first install java i.e both JRE and JDK. To install JRE, go with this link.



4) But in order to start you need JDK too. Just open synaptic manager and search for oracle-jdk7-installer if you've followed above link to install JRE on your machine.


5) Start your Apache tomcat by using the following command



/etc/init.d/tomcat6 start

6) If you want t stop,

execute /etc/init.d/tomcat5.5 stop
if you want to restart the service

execute /etc/init.d/tomcat5.5 restart











If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Thursday, May 17, 2012

Which one is better ? open-jre or sun java ?

On a whole, open java and sun java are 99 % similar. As oracle purchased sun company, java is taken into oracle and tried to make it proprietary. Open jdk / open jre is under GNU Public License and is free (free in terms of freedom not as in price). So whatever may be the issue, there are currently no major issues running both of them side by side. 


But today, as I re-installed my Operating system i.e Ubuntu, I need to check for java plugin support for browser. I've already installed open-jre in my system but it don't enable jre in browser i.e java plugin in browser. i didn't find any browser specific plugins on the internet. Tried installing sun java from oracle.com but couldn't succeed because I've downloaded a Linux version .tar.gz file which is self extracting archive. Oracle.com suggested to execute .bin file in that folder and surprisingly it is missing (Amazing support !).


Finally discovered a way on the internet and below are the steps.


sudo add-apt-repository ppa:webupd8team/java


sudo apt-get update


sudo apt-get install oracle-java7-installer


sudo apt-get update

Voila ! that works ! :)

Consider this before choosing.



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged