Eclipse: Workspace Unavailable
by Steve on Mar.10, 2011, under Computers
Eclipse isn’t known for it’s helpful error messages at the best of times – and here’s one example… “Workspace in use or cannot be created, choose a different one.”
Unfortunately, Eclipse doesn’t offer any suggestions on how to fix this, so some manual searching was required. Here is what worked for me:
- Remove the workspace lock:
- close Eclipse – and go to the .metadata folder in your workspace, e.g. C:\workspace\.metadata.
- delete the .lock file in this folder.
- in some cases you may be prevented from deleting the .lock file (see error message below). If this is the case, move to Step 2.
- End the Javaw process:
- open Task Manager, and end the process javaw.exe.
- return to the metadata folder, and delete the lock file.
- restart Eclipse.
Eclipse should now open your workspace correctly.
Viewing Unread Messages Quickly in Gmail
by Steve on Dec.06, 2010, under Internet
One of the most regular complaints about Gmail is the difficulty in quickly viewing your unread messages. The simplest solution is to do the following:
1) In the Search bar at the top, enter one of the following:
label:unread
or
is:unread
2) Click on “Search Mail”. You will now be presented with all of your unread emails.
However, at times when I really need to access my unread mail quickly, I often forget these commands – and have to search online for them – which defeats the whole purpose of saving time. So here’s a method of creating a permanent link to your unread messages – that you can then access with one mouse-click.
1) Go to Settings -> Labs, and enable the “Quick Links” feature.
2) You will now see a new “Quick Links” menu on the left-hand side of the screen (above “Invite a friend”).
3) Follow the same “Search Mail” steps above… then, with the unread messages on screen, select “Add a Quick Link” in the new menu.
4) Save the Quick Link as “Unread Messages” (or whatever you prefer) and you now have one-click access to all unread mail.
Ant Errors: “Error starting modern compiler”
by Steve on Sep.14, 2010, under Code Monkey
In my case, this error appeared when I attempted to run an Ant script through Eclipse, that was designed to compile Java classes and package them into a ZIP file.
BUILD FAILED
%my XML file%: Error starting modern compiler
This problem can arise in different development environments, and for different reasons – though generally these reasons are all related – the version of Java being used by the compiler does not match that already loaded by the VM, or being referred to in JAVA_HOME.
To solve this in Eclipse, I first went to Run > External Tools > External Tools Configurations … and accessed the JRE tab.
The next step, change from “Run in the same JRE as the workspace” to specifying a “Separate JRE”:
However, this change still resulted in the “modern compiler” error being displayed. The final step? Despite the prompt asking for a separate JRE – it is in fact the JDK that needs to be selected:
And voila – you should now see these happy words…
BUILD SUCCESSFUL
Java Errors: “UnsupportedClassVersionError…bad major version at offset=x”
by Steve on Sep.09, 2010, under Code Monkey
In my case, this error appeared when I attempted to load a class from a batch file in the Windows command prompt.
“Caused by: java.lang.UnsupportedClassVersionError: (*myclassname*) bad major version at offset=6”
This error indicates that your projects were compiled with a higher level Java compiler than the runtime can support.
Firstly, confirm what version of Java is installed on your machine. In Windows, open a command prompt window and enter the following command:
java -version
The output will look something like:
java version "1.5.0_22"
Java(TM) SE Runtime Environment (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)
This message confirmed that my runtime environment was Java 5 – but error above was stating the classes had been compiled in Java 6. The next step is to check what version of Java is being used to compile your project. In my case, I was using Eclipse.
Go to Window > Preferences > Java > Installed JREs and make sure your 5.0 runtime shows up in the list and is checked. If nothing suitable appears in the list of options, then you need to download the correct Java version from the Sun website.
Finally, go to Window->Preferences->Java->Compiler and ensure that your Compiler compliance level is set to 1.5.
How To Rename a Series of Files (MS Windows XP)
by Steve on Jan.28, 2010, under Computers
I’m amazed that I never knew about Windows XP’s built-in function to rename a series of files. It’s limited (with other available applications giving you more control over the renaming style), but it’s fast and easy.
- Open My Computer/Windows Explorer to the folder containing the files you want to rename.
- Select the group of files that you wish to rename.
- Right-click on the first file in the list and choose Rename from the menu options.
- Type a new name for the file…
- Note that the first file will change to the name you type, while all other selected files will append a number enclosed in brackets to this name.
- For example, if you typed ‘file.jpg’, the rest of the files will change to ‘file (1).jpg’, ‘file (2).jpg’, etc.
- When sorting by name, the unnumbered file will sort to the bottom of the list. To avoid this, include the starting number in the name you type, e.g. ‘mynewfile (1).jpg’. The numbers for the other files will continue from this number. Remember to include the space and brackets.
Keyboard layout shenanigans (MS Windows)
by Steve on Jul.01, 2009, under Computers
Every now and then, I used to suffer the problem of having my keyboard layout change seemingly for no reason. For example, my @ key would change to Shift+2 instead of Shift+’ – and vice versa with the ” key.
I’ve now figured out that the problem has been my keyboard layout changing language (in my case, from “Irish” to “US”). Turns out the keyboard shortcut to change your input language is LeftAlt+Shift, which I must have been pressing by mistake. So all I had to do was press this combination again to restore my keyboard to the way I knew and loved. It’s easy when you know how!
If you need to check a) what input languages are installed for your computer, and b) what your shortcut is for switching between these languages – then go here:
Control Panel -> Regional & Language Options -> Languages -> Details -> Settings -> Key Settings
(csd2ikmze9)
Killing ActiveX warnings when developing…
by Steve on May.20, 2009, under Code Monkey, Internet
If, like me, you’re sick to the back teeth of IE blocking your attempts to debug your own apps with it’s ActiveX filter – here’s how to stop it.
Note: This is for running locally off your machine – it should still block the ‘evil’ websites perfectly fine.
- In IE 7, go to Tools->Internet Options->Advanced
- Scroll down to ‘Security’ in the Settings pane
- Tick the box next to “Allow active content to run in files on My Computer”
Now run/debug your project once more (e.g. from Eclipse), and it should work fine!
Displaying tooltips for truncated items in a Flex List
by Steve on May.14, 2009, under Code Monkey
Just a quick post – for anyone who might be suffering from the same issue that I did…
Question: In a standard Flex List – shrink the width of the List so that it is smaller than the width of the items inside it. How do you see the full text without adding a scrollbar?
Answer: In the MXML for the List – simply add the following line…
itemRenderer="mx.controls.Label"
…and bingo, the items in question will be truncated – and a tooltip will automatically appear to display the full text (when you hover over the item).

Hiding ‘included’ database connection files using PHP…
by Steve on Jan.28, 2009, under Code Monkey
Interesting link that lists a few different solutions for keeping your connection/config file from prying eyes. The first answer in particular looks handy…
Check it here.
To Twitter, or not to Twitter….
by Steve on Jan.26, 2009, under Internet
I’ve signed up with Twitter – one of the biggest Internet thingamabobs out there that I hadn’t tried yet. All based on a recommendation from the great Stephen Fry – he of QI fame.
On first look, it seems to be the ’status’ part of facebook, and not much else. I’m not sure yet how you start getting something out of it. Maybe it depends on how many of your friends you find on it? Or how many interesting ‘new’ people you start to stalk?
EDIT: By the way, you can find me on Twitter here.



