0

I'm on Windows 7, using javah in Cygwin 1.7.13. I'm currently attempting to generate the header file for a native C++ file for my Android project.

Run in the root of the project, the command I'm executing is:

walb@nought /cygdrive/c/Users/walb/stuff/work/workspace/SoundBites
$ javah -verbose -d jni/ -classpath bin/classes uk.co.biogen.SoundBites.activity.SoundBitesActivity

Which results in:

error: cannot access uk.co.biogen.SoundBites.activity.SoundBitesActivity
class file for uk.co.biogen.SoundBites.activity.SoundBitesActivity not found
javadoc: error - Class uk.co.biogen.SoundBites.activity.SoundBitesActivity not found.
[ Search Path: C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\sun
rsasign.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.j
ar;C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes ]
Error: No classes were specified on the command line.  Try -help.

Most of the topics I've read indicate that I've got the -classpath argument correct. The interesting bit of the error message is:

[ Search Path: C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\sun
rsasign.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.j
ar;C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes ]

The last path in that list is C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes, which indicates javah is interpreting the argument completely wrong. The only thing I can think might help is some alternative way of calling javah, but adding its directory to PATH is the only means I can think of.

Community
  • 1
  • 1
william.berg
  • 85
  • 3
  • 14

2 Answers2

2

Just implemented what I wanted in native Android. It's easier to integrate and understand what's going on, at the expense of speed and actually doing what I wanted in the first place.

william.berg
  • 85
  • 3
  • 14
1

Does this work (adding a semi-colon before your path for the -classpath argument):

javah -verbose -d jni/ -classpath ;bin/classes   uk.co.biogen.SoundBites.activity.SoundBitesActivity
randusr836
  • 445
  • 1
  • 3
  • 16
  • Sorry I've come back to this so late. Tried your idea - sadly doesn't work, `bin/classes` is taken to have a forward slash. Don't worry, though; I eventually gave up trying to get the NDK to work and implemented what I wanted in Android instead. Thanks! – william.berg Aug 07 '12 at 10:12