I had a self created jar from another projected imported as a library into my other project. When I changed code in that project and exported a new jar to replaced the old o
Although your problem seems fixed, I ended up here with a similar error (while building the samples from developer.android.com). In case it's helpful to others, I was able to solve it by setting JAVA_HOME to the appropriate value. In my case it was:
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64