机器人 - javah的没有找到我的课 [英] android - javah doesn't find my class

查看:86
本文介绍了机器人 - javah的没有找到我的课的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有麻烦使用 javah的生成的JNI的C头文件。

I am having troubles generating the C header file for JNI using javah.

下面是我用站在而脚本中的<项目目录> \ BIN 目录:

Here's the script I use while standing in the <project-dir>\bin directory:

javah -classpath C:\PROGRA~2\Android\android-sdk\platforms\android-8\android.jar com.test.JniTest

作为回报,我得到:

As return I get:

ERROR: Could not find class file for 'com.test.JniTest'.

尽管类 JniTest 肯定是 \ COM \测试

我是什么做错了吗?

推荐答案

您指定的类路径中包含的只有的android.jar

You specify the classpath to contain only android.jar.

您还需要包括在您的类存储的位置。在你的情况下,它是当前目录,所以你需要使用 。(按分离; 在Windows上)。该调用应该是这样的:

You also need to include the location where your classes are stored. In your case it is the current directory, so you need to use . (separated by ; on Windows). The invocation should look like this:

javah -classpath C:\PROGRA~2\Android\android-sdk\platforms\android-8\android.jar;. com.test.JniTest

这篇关于机器人 - javah的没有找到我的课的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆