Wednesday, October 21, 2009

Getting Started with Eclipse

For about the last month I have been learning Java. Due to outside requirements, I have been using the BlueJ IDE for development. However today I decided to give Eclipse a try.

I installed version 3.2.2 from the Ubuntu repos and loaded a project I had just completed in BlueJ. It was then that I was greeted with a few errors regarding my code. The first of which was:

    Scanner cannot be resolved to a type

The line of code in question was:

    private Scanner userInput = new Scanner(;

Strange, I thought, since I had made no changes to the code and had just compiled and run this project in BlueJ.

I first checked the installed version of Java:

    $ java -version
    java version "1.6.0_0"
    OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
    OpenJDK Client VM (build 14.0-b08, mixed mode, sharing)

    $ javac -version
    javac 1.6.0_0

Ok, everything looked good there. I checked the compiler settings in Eclipse and changed the compiler from 5.0 compliant to 6.0 compliant. No joy.

After some more digging I concluded that the issue was probably that Eclipse was not using the proper JRE. Sure enough, Eclipse was using version 1.5 at /usr/lib/jvm/java-1.5.0-gcj-4.3- I added another JRE entry pointing to /usr/lib/jvm/java-6-openjdk (which is what my BlueJ installation was already using) and voila! No more errors.

I guess I should look into cleaning up the multiple JRE's I have installed on this machine.

But first, back to exploring Eclipse!

Monday, October 12, 2009

User Database Manager

As I wrote about back in June, I have been getting back into programming this year. I started off in Python and it went well. Approximately two months in, I was able to write a simple database manager. It actually started as a response to LaRoza's Beginner's Programming Challenge #7 and turned into a bit of a monster as I added more and more functionality once I satisfied the initial requirements. The program is written in Python and uses a sqlite database. The requirements are pysqlite 2.x on the client machine in addition to an installation of Python.

I figured that since the program is robust and feature-complete (albeit limited in scope), it would be worthwhile to officially release it under a GNU GPL. This will happen once I figure out what hosting service and/or version control system to use.  Hopefully, someone out there in learner-land may find it useful.

Thursday, October 8, 2009


After months of neglect and with a little bit of inspiration from the Cellular Obscura blog, I decided today to revive my Flickr account. My photostream has been added to the sidebar. Hopefully I'll be able to fill it with some noteworthy photos.

Strange Display Issues

Recently I have been having a very strange issue with my desktop box. After I log in (sometimes immediately, sometimes after just a few minutes), menus stop appearing. This includes the Gnome-panel menus as well as the menus in any program I may be running or the right-click context menu in Nautilus. When I click a menu, its color changes to indicate that it has been clicked like it normally would, but I don't see the menu.

If I am running any program such as Nautilus or Totem when the problem occurs, I can keep using it normally (as long as I don't need to access a menu or right-click anything), but the only way I have found to resolve the issue is by restarting X (after having installed dontzap and re-enabling the ctrl+alt+backspace shortcut).

Also-- I use Gnome-Do's Docky interface. I noticed that if I click an icon in Docky while this problem is going on, the icon grows like normal then nothing happens: the program does not launch and the icon doesn't shrink back to its normal size either.

So, this seems to be some weird problem with my desktop not refreshing or something. I do not recall making any changes recently, other than installing a few updates when prompted (sorry, I don't recall which ones, but this came up about 2-3 weeks ago).

Over the weekend I installed a host of updates (including some kernel updates and the problem seemed to go away. Unfortunately, that proved not to be the case: I'm still having the problem, although I have some more information about what seems to be going on. 

It all seems to be related to an episode I had a few months ago after I inadvertently allowed my $HOME partition to fill up. I wrote about it in all its painful glory here.

Since that time everything has seemed fine, except weird issues I've been having in Banshee. I noticed after I addressed the issues caused by the full partition that whenever I launched Banshee, it would never remember my view settings (it did before the problems I had). For example, one view pane would always be reduced to about 5% of the viewable screen instead of the 60/40 split I would always use. Every time I launch Banshee the first thing I do is resize the view panes to the way I like them, but it never remembers the preference (again, it used to remember).

The display issue I wrote about in my first post seems to have started coming up after Banshee locked up when I paused a movie I was watching. I killed the program with the Force Quit applet. I think that this is when the display issues started.

As I mentioned above, the problems seemed to stop when I installed some updates (including a Kernel update). Tonight I re-installed the latest kernel through Synaptic and the issue seemed to stop again.

I'm going to play around with Banshee and see if I can cause this to happen again. What I'm wondering is whether what I'm describing about Banshee and the other issues ringing any bells to anyone. Am I touching on something here? If I am able to cause this to happen by causing a Banshee lockup again, I guess I could try to back up my banshee.db then completely remove/ reinstall the program and see if it performs normally again.