1

When I'm trying to create a headerfile with javah I get an error that he can't find the Parcelable class.

Before I created the header with:

From %PROJECTDIR%/bin/classes/

javah -classpath com.my.project

But now I added the Parcelable to the native calls I include the android.jar to the commandline call: From %PROJECTDIR%/bin/classes/

javah -classpath :~/shared/android.jar:~/shared/MyProject/bin/classes com.my.project

I will get this error:

Error: Class android.os.Parcelable could not be found.

What am I doing wrong?

Ion Aalbers
  • 7,830
  • 3
  • 37
  • 50

2 Answers2

1

I had the same error message but a different problem (under Windoze). For some reason i had to quote the classpath although there was no whitespace in the path:

C:\myProjectPath>javah -jni -classpath "C:\Users\myUserName\android-sdks\platforms\android-15\android.jar";bin\classes -d jni package1.package2.myInterestingClass

And this didn't work:

C:\myProjectPath>javah -jni -classpath C:\Users\myUserName\android-sdks\platforms\android-15\android.jar;bin\classes -d jni package1.package2.myInterestingClass

And it worked when using a relative path:

C:\myProjectPath>javah -jni -classpath ..\..\..\..\..\Users\myUserName\android-sdks\platforms\android-15\android.jar;bin\classes -d jni package1.package2.myInterestingClass

Spent a few hours on this, windows is really weird most of the time. Maybe this helps someone else.

Michi
  • 681
  • 1
  • 7
  • 25
0

Found the problem... I had one colon to many.

javah -classpath ~/shared/android.jar:. com.my.project
Ion Aalbers
  • 7,830
  • 3
  • 37
  • 50