Eclipse

July 16, 2010

I’m sure that you have heard of Eclise.  If not then all you need to know is that it is a very popular (and for a good reason) IDE mainly for Java.  However, it does also have C/C++ support, but it is mostly used with Java.

As you know, I’m not big on programming in Java.  But I recently purchased a Nexus One phone, and the IEEE SECon got me a little interested in Android application development.  I don’t plan for anything I make to be widely distributed, but rather just for personal use.  In any case, I would still need a place to create my programs.  Sure this can be done with a normal text editor and the command line but why bother with that when Eclipse and the Android SDK make it so simple?

I’m going to talk about getting and installing Eclipse onto you system (which I will assume to be Ubuntu).  Sure you could just run sudo apt-get install eclipse but this way assumes that you are using the OpenJDK version of Java and not Sun’s. So if you are using SunJava, which it seems most people do, then this how-to is for you.

First head over to the Eclipse site and download the IDE. To find the site just use Google and then do some reading and clicking, so there is no need for me to post a link. If you can’t get past this step then you probably shouldn’t be thinking about using Eclipse.

Next we will open the package you have just downloaded and then move it to the /opt directory. To do this just run the following sequence of commands:

tar xzf <filename>
sudo mv eclipse /opt/eclipse
cd /opt
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x `sudo find eclipse -type d`

The chown command changes the owner of a file/directory, if you have been reading this blog then you should be able to figure out what the other commands do.

Next we will add eclipse executable to your path.

sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudoedit /usr/bin/eclipse

then add this to the file

#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

I’m not all to sure exactly what the touch command does but you can look that up yourself (either online or with man).

Finally, the “most important” part; creating a GNOME-menu icon. This is something that would normally be done when you use the apt-get method.


cd /usr/share/applications
sudo nano eclipse.desktop

And enter the following into the created file;

[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

All the stuff entered into the file makes perfect sense, so if you ever wanted to make a menu item for any other program you now know how.

All of these steps can be found at http://flurdy.com/docs/eclipse/install.html.

Advertisements

Pidgin Key Bindings

August 17, 2009

First, for those of you that don’t know what key bindings are.  Basically they are keyboard shortcuts.

Well Pidgin has one that I find rather annoying, it clears the scroll back history of a conversation.  The default key binding for this is <Control>l (the control and l key pressed together).  Now anyone that uses firefox and just about any other web browser knows that this allows you to edit the URL.  Naturally, I have Pidgin running I tend to also be using firefox.  So when I mistakenly think that firefox is the selected window and I want to change the URL I hit <Control>l.  Only to find that the Pidgin conversation window was selected.  This happened often enough for me to learn how to fix this.

The file that contains the key bindings for Pidgin are located at ~/.purple/accels.  All you have to do now is find the key binding that you want to change and change it to whatever you desire (or delete it if you so wish).  Time to introduce a new text editor (well new in the sense that I haven’t talked about it before on this blog), pico.  The format is just pico file, and the file’s contest will be displayed in the terminal. At this point you proceed as you would with any other text editor. Also there are additional commands at the bottom of the screen if you ever feel the urge to use them.

So let’s assume that you changed <Control>l to <Control>e, then saved the file.  Well this won’t work and here is why.  The line that you edited started with a ‘;‘ (semicolon), and GTK+ interprets this as a comment.  So your change has no effect.  Thus in addition to changing the key binding, you also need to remove the semicolon from the beginning of the line.