## How hard can it be?

The taskbar is all new and shiney in Windows 7 but it appears that it’s really hard for these newfangled collections of open-and-closed programs to just allow a shortcut. Ubuntu has Unity and one of the first things I came across was that I couldn’t keep some programs in the ‘taskbar’on the left  (I don’t really know how Ubuntu calls it) . Same goes for Eclipse in Windows it seems. I’m using a 64 bit version of both Windows and Eclipse. Eclipse version is 4.1.1

## It’s a bug!

After some google-fu I found this ‘double entry in the taskbar’ bug. The bug is not the same (“Eclipse icon is duplicated in taskbar”), but it seems the problem has the same cause and we can actually use one of the tricks down in the comments! Winz. My guess is the origional bug starts when you upgrade your Eclipse and allready have an Icon: then you have an icon you use to start eclipse, which makes a second non-pinable entry in the taskbar. To get from there to ‘my’ problem: just remove the first pin :)

## Getting the “pin to taskbar” to show

From this comment by ‘riccardo’ we can figure out that an extra line or 2 is needed in the eclipse.ini file. Adding the location of the VM should fix all your sores.

1. If you haven’t: remove any old pinned eclipse icons.
2. Find your eclipse directory, and the eclipse.ini file.
3. Add the following 2 lines:
-vm
disk:\path\to\JRE\bin
4. Save
5. Run, and wait for the main screen to show (so not the splash or the workspace chooser)
6. Right click, choose pin, have a drink.

These are the complete contents of my current eclipse.ini file:

-vm
C:\Program Files\Java\jre7\bin
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m

After starting eclipse the first lines were automagically changed to this, but I don’t really think that matters :)

-vm
C:/Program Files/Java/jre7/bin

## Troubles

Things can go wrong. You can read the comments of the linked bug above, but some common problems are:

• Not giving the ‘-vm’ and ‘path’ lines a separate line.
• Unstable behavior of Eclipse. Haven’t gotten that, but if you do, you can remove the ‘-vm’ line after pining.
• If you update your JRE, you might need to update the path too in your ini, I’m not really sure.
• Some people need a full reboot for any of this to work. (I didn’t by the way)

And while windows 8 is a whole new beast, it can’t hurt to add this tip in the comments by “VinnyJames”:

If you move the icon after pinning and before exiting eclipse it may not stick (this happens to me on Windows 8.1).

vm in ini, start, wait, pin, move pinned icon, exit = fail
vm in ini, start, wait, pin, exit, move pinned icon = success

### New project, new problems.

Another minor fix you “just need to know”. After some server changes (I moved my SVN installation for one), I decided to just start a new Eclipse project as opposed to ‘fixing’ the old one to the new SVN location.

My basic steps are somewhat like:

• Make a new Android project with some fake settings
• Connect to SVN
• Team->revert the hell out of it

Most of the time this works well.

### The problem:

There seems to be a class missing, but there isn’t:
After having all the files, the application still doesn’t work. It compiles and goes to the emulator nicely, but then this happens:

ERROR/AndroidRuntime(287): java.lang.RuntimeException:
Unable to instantiate activity ComponentInfo{packageNameGoesHere}:
java.lang.ClassNotFoundException:
dalvik.system.PathClassLoader@44e7a8a8

And:

Caused by: java.lang.ClassNotFoundException:
packageName.ClassName in
(PathClassLoader.java:243)

No fun at all.
This error is quite obvious: it calls a certain class that cannot be found. In this case it was the class of my main activity. Not a thing that would be easily to miss. It was there in the source of course, no errors in sight, etc, but it still didn’t register as being there. This is of course a warning sign that something is wrong with your building path. But what?

### The Solution

For some reason Eclipse had decided that –as opposed to every sane default–  my /src folder didn’t need to be in my build-path. Easily fixed if you this is the problem:

• Open the build-path (right-mouse on the project -> build-path -> configure build path, or project-properties-> Java Build Path)
• Click the Source tab.
• Make sure your /gen and your /src paths are listed there.
• While you’re at it, if you use google analytics, make sure that libGoogleAnalytics.jar is present in the libraries tab!

### Scope

Because I was trying Ubuntu 10.10 on my laptop, I had to install a new development environment. Not too much work: I’ve used the installing instructions from Google [1].

This basically boils down to:

1. Install Eclipse (I just used the ubuntu software center for this).
3. Install Android ADT plugin for Eclipse using the Eclipse install-software feature [2]
4. Set the path to the android SDK / tools (step 2)  in the Eclipse preferences.

I didn’t install the JDK, because it was on my machine by default. I assume the package manager has that, but I’m not sure. Now I’m all happy with my new toys, installing Subclipse for SVN, getting my source, and coding away. Then the trouble started :)

### Symptoms

It seems that I couldn’t  start any Android Virtual Device (AVD). I made a new run configuration, but it didn’t start. Instead I got an error, stating:

‘Launching android’ has encountered a problem.

An internal error occurred during : “Launching android”.

Clicking “details >>” produces an extra line:

Path for project must have only one segment

And, for full disclosure, the complete log-entry included trailing this post.

### Cause & Solution

It seems that this rather cryptic message means nothing more in my case than “please enter a name and project for your run configuration”. I did have a “name”, but left the “Project” field empty. Entering a value in the ‘project’ (the “AndroBlip” you see next to ‘browse’) fixed it. Sources seem to indicate that the same error is produced if you don’t enter a value in the ‘name’-field.

Screenshot

### Complete error log

!ENTRY org.eclipse.core.jobs 4 2 2011-02-20 12:12:00.397
!MESSAGE An internal error occurred during: “Launching android”.
!STACK 0
java.lang.IllegalArgumentException: Path for project must have only one segment.
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.internal.resources.WorkspaceRoot
.getProject(WorkspaceRoot.java:181)