Tuesday, November 13, 2012

Options Menu won't show in ICS(Ice Cream Sandwich)

I am developing an application in android and decided to code at the options menu, to add some preferences/settings. As I want to see the output of my code, I notice that the options menu isn't showing, no matter how I override the onCreateOptionsMenu(..), and decided to hit google. This link gives the ANSWER.

You must change the targetSdkVersion to <= 10 in the manifest.xml, and run the code again, and successfully the options menu showed.

Friday, November 2, 2012

Access Denied for phpmyadmin in XAMPP 1.8.1 - Ubuntu

I installed the XAMPP 1.8.1 for linux in my ubuntu and ran http://localhost/phpmyadmin, and suddenly it gives an error Access Denied! Really in my localhost? yeah!

The Fix:

  1. Navigate to the file "httpd-xampp.conf" mine is "/opt/lampp/etc/extra/httpd-xampp.conf"
  2. Add "Require all granted" to this block of code
    #
    
        AllowOverride AuthConfig Limit
        Order allow,deny
        Allow from all
    
    #
    
  3. The result will be
    #
    
        AllowOverride AuthConfig Limit
        Order allow,deny
        Allow from all
        Require all granted
    
    #
    
  4. Then restart your lampp
    #
    sudo /opt/lampp/lampp restart
    #
    

Thursday, November 1, 2012

Manual Install Eclipse - Ubuntu

I'm tired of searching in the internet on how to manually install eclipse. I am not using the Ubuntu Software Center to download eclipse because I want the Eclipse Helios to be installed.


  1. Download the Eclipse Helios. You can download any package you want. I downloaded the eclipse-jee-helios-linux-gtk.tar.gz 
  2. Extract and copy it to the /opt directory
    
    sudo tar -vxzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz -C /opt
    cd /opt
    sudo chown -R root:root eclipse
    sudo chmod -R +r eclipse
    
    
  3. You can also change the root:root to user:user
  4. Create an executable
    sudo touch /usr/bin/eclipse
    sudo chmod 755 /usr/bin/eclipse
    sudo gedit /usr/bin/eclipse
  5. Paste this to gedit and save
    #!/bin/sh
    #export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
    export ECLIPSE_HOME="/opt/eclipse"
    
    $ECLIPSE_HOME/eclipse $*
    
  6. Create a shortcut
    sudo gedit /usr/share/applications/eclipse.desktop
    
  7. Paste to gedit
    [Desktop Entry]
    Encoding=UTF-8
    Name=Eclipse
    Comment=Eclipse IDE
    Exec=eclipse
    Icon=/opt/eclipse/icon.xpm
    Terminal=false
    Type=Application
    Categories=GNOME;Application;Development;
    StartupNotify=true
    
  8. And launch Eclipse for the first time
    sudo eclipse/eclipse -clean
    

Could not get lock - ubuntu

I encountered some problems when I ran some apt-get in ubuntu then stopping it by pressing ctrl+z, and run some other apt-get command again, then suddenly the CLI throws - Could not get lock . . . . . . etc

I think there are many cases on how you get that "could not get lock..". What I did in mine is, run this in the CLI without the double quotes "killall -9 apt-get" and run apt-get again.


Install OpenJDK 6 on Ubuntu 12.04

  1. Open up a terminal
  2. type this command without quotes "sudo apt-get install openjdk-6-jdk" and hit enter. Just type y if you want to proceed.
  3. After it downloaded all the packages needed, then you're ready to go.
  4. To check the Java version
    1. Just type without the quotes "java -version" 
If you're really wondering what are the differences between Sun's JDK and OpenJDK, here are some useful links:
  1. Stackoverflow 
  2. Ask Ubuntu 
  3. Exploding Java
Google is your friend.