Tuesday 18 October 2011

Adding JRE in Eclipse

If you have multiple JREs installed on you system you can add all of them in Eclipse following these steps:

1. Open Window > Preferences


2. Go to Java > Installed JRE section. This section lists all the JREs that are currently added in eclipse.



3. Click on Search button and select the root directory in which your JRE/JDKs are installed. I'm using Ubuntu 11.10 and all the JDK/JRE that I'm using are installed in /usr/lib/jvm, hence I chose this directory as root to reduce search time.

After search completes all the JRE found will be listed in screen.


4. Select the default JRE by clicking on the check-box next to it in the list and click OK button.
You can also add individual JRE by clicking the Add button and following the on-screen instructions.

Friday 14 October 2011

Installing VMWare Tools on Ubuntu 11.10(Oneiric Ocelot)

Ubuntu 11.10(Oneiric Ocelot) released yesterday and I installed 32-bit desktop version on VMware Player. Installation was smooth and everything went great until I realized that VMware Tools was not installed automatically by VMware Easy Install. So I thought of installing it manually from VM > Install VMware Tools.


But this reported an error "VMware Tools installation cannot be started manually while the easy install is in progress". Luckily VMware  provides solution for this [1] :

1. Poweroff virtual machine

2. Go to virtual machine settings

3. Remove Floppy and CD/DVD(ide) from Hardware.

Power on the virtal machine now and insall VMware tools manually ( VM > Install VMware Tools) [2].

1. Extract VMwareTools in a temp directory
   $ cd /tmp
   $ tar zxpf /mnt/cdrom/VMwareTools-<x.x.x-xxxx>.tar.gz

2. Install Vmware Tools
  $ cd vmware-tools-distrib
  $ sudo ./vmware-install.pl

3. Answer few configuration related questions and tools be installed. The questions already have a default answer so you just need  to press Enter key most of the time, until you want to configuew something differently.

The installer was not able to able to find the path to kernel header

Searching for a valid kernel header path...
The path "" is not valid.
Would you like to change it? [yes]

What is the location of the directory of C header files that match your running kernel?

4. Open a new terminal and apply the following fix for kernel headers [3]
  $ cd /lib/modules/$(uname -r)/build/include/linux
  $ ln -s ../generated/utsrelease.h
  $ ln -s ../generated/autoconf.h

5.  Specify the header directory in first terminal:  
  /lib/modules/xxx/build/include/
where xxx is the kernel release version. You can get it from the following command
  $ uname -r


REFERENCES
[1] http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017687

[2] http://www.vmware.com/support/ws55/doc/ws_newguest_tools_linux.html

[3] http://superuser.com/questions/199365/vmware-linux-headers-not-found-for-ubuntu-10-10

Thursday 19 May 2011

Touchpad problem in Ubuntu 11.04


I upgraded HP Mini 110 netbook last week from Ubuntu 10.10 to 11.04. Though it some really cool features, it created some serious trouble (atleast for me) with touchpad. Edge scrolling and middle button emulation stopped working. It was very annoying as I'm too much used to these features.

I found many patches for this problem but I'm reluctant to applying patches from untrusted sources. After some more research I found a simple solution for these problems:

1. Install gpointing-device-settings
sudo apt-get install gpointing-device-settings

2. Open System -> Preferences -> Pointing Devices, and enable Edge Scrolling and Middle Button Emulation.

3. Restart.

After restart a new tab "Touchpad" was added in System -> Preferences -> Mouse that provides various options for customzing touchpad features. More advanced features are available in System -> Preferences -> Pointing Devices.

Now I can edge scroll vertically/horizontally, scroll using two fingure drag and right click by tapping with two fingures. There is much more to TRY OUT!!!

REFERENCE
http://ubuntuforums.org/showpost.php?p=10751052&postcount=209

Friday 11 March 2011

HOW-TO: Enable logs in tomcat

When you install tomcat 6 from Ubuntu's repository, it does not write the access log automatically. To enable logging uncomment the following line in /usr/share/tomcat6/conf/server.xml

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>

Save the changes and restart tomcat:

$ /etc/init.d/tomcat6 restart

The logs will be stored in /usr/share/tomcat6/logs/ directory which is a symbolic link to  /var/log/tomcat6/ directory.