I tried to include android.jar into Java project, remove JRE from Build Path and run this code. It throws Runtime exception. Why?
android.jar contains stubs only, enough to let you build your project, as @antlersoft explained.
The Robolectric project http://robolectric.org/ allows you to run tests on your Android code without using a device. They have real builds available on Maven http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.robolectric%22
I have been successfully running most of the Android backend code by using the android-all artifact.
Might not help in your specific case, since some APIs are still out of bounds, but for most other cases of java.lang.RuntimeException: Stub!
including the artifacts from Robolectric should help.