aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help in javah" Watch "help in javah" New topic
Author

help in javah

Vishal Gautam
Greenhorn

Joined: Dec 18, 2004
Posts: 1
Hi

I am a newbee to java and jni

I have following code


package com.vishal.practice;
import java.io.PrintWriter;
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);
ob.test();
pw.write("After: " + ob.i);
}

public native void test();

static
{
System.loadLibrary("NativeDemo");
}
}



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

Regards
Vishal


~Vishal
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10


[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


JavaBeginnersFaq
"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: http://aspose.com/file-tools
 
subject: help in javah