javah帮助 - “没有在命令行上指定类” [英] javah Help - "No classes were specified on the command line"

查看:124
本文介绍了javah帮助 - “没有在命令行上指定类”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行安装了Eclipse的Ubuntu Linux,并且我正在尝试使用JNI
这样做我需要使用javah,但它似乎没有工作
我有刚刚安装Ubuntu并且我不熟悉Linux / bash shell

I'm running Ubuntu Linux with Eclipse installed, and I'm trying to work with JNI to do so I need to use javah, but it doesn't seem to be working I have just recently installed Ubuntu and am unfamiliar with Linux/bash shells

我的eclipse项目名为myJNI,我的类DoJNI包含本机方法。

for my eclipse project called myJNI, I have class DoJNI containing the native method.

在终端:

javah -classpath .;\home\thomas\Documents\LinuxProgramming\EclipseWorkspace\myJNI\bin\org\me\jni DoJNI

我得到的错误是:
在命令行上没有指定类

errors I get are: No classes were specified on the command line

推荐答案

使用正斜杠代替反斜杠,冒号而不是分号:

Use forward slashes instead of backslashes, and a colon instead of a semi-colon:

javah -classpath .:/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/myJNI/bin/org/me/jni DoJNI

另外,我怀疑那个你没有真的想在类路径上使用org / me / jni,而只需要 bin 目录,使用类名 org.me.jni.DoJNI

Also, I suspect that you don't really want org/me/jni on the classpath, but just the bin directory, using the classname org.me.jni.DoJNI:

javah -classpath .:/home/thomas/Documents/LinuxProgramming/EclipseWorkspace/myJNI/bin org.me.jni.DoJNI

这篇关于javah帮助 - “没有在命令行上指定类”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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