File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes help in javah Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help in javah" Watch "help in javah" New topic

help in javah

Vishal Gautam

Joined: Dec 18, 2004
Posts: 1

I am a newbee to java and jni

I have following code

package com.vishal.practice;
public class NativeDemo
int i;
public static void main(String[] args)
NativeDemo ob = new NativeDemo();

ob.i = 10;
PrintWriter pw = new PrintWriter(System.out);
pw.write("Before: " + ob.i);
pw.write("After: " + ob.i);

public native void test();


I have compiled the code to build .class file

when I try to execute the following command

javah -jni com.vishal.practice NativeDemo

I get the following error

Error: Class com.vishal.practice.NativeDemo could not be found.

Not Sure what the reason is.

Please Help


Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059

[b]I am a newbee to java and jni</b>

I think that jni is not a beginner topic. However, I wonder if your problem is in the way you are using the command rather than with your code. What if you put a dot before NativeDemo? Like this:

javah -jni com.vishal.practice.NativeDemo

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: help in javah
It's not a secret anymore!