Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javah error: could not find class file for 'com.ntv.ndkjni'

2717046Jul 21 2014 — edited Jul 24 2014

Hi,

My project directory : C:\ndkJNI

My java file directory : C:\ndkJNI\src\com\ntv\ndkjni

My package name : com.ntv.ndkjni

1 ) I entry command prompt at C:\ndkJNI\src\com\ntv\ndkjni

2 ) Javac test.java and create test.class succesfully. test.class is in C:\ndkJNI\src\com\ntv\ndkjni folder.

3 ) Later I used Javah, try below javah variously

 a)  _javah -classpath C:\\ndkJNI\\src\\com\\ntv\\ndkjni test_

 _b)  javah -classpath C:\\ndkJNI\\src\\com\\ntv\\ndkjni.test_

 _x) javah _\-classpath C:\\ndkJNI\\src\\com\\ntv\\ndkjni __com.ntv.ndkjni._test___

 ___y) _javah _\-classpath C:\\ndkJNI\\src\\com\\ntv\\ndkjni __com.ntv.ndkjni_ test______

 _c)  javah -classpath C:\\ndkJNI\\src\\com\\ntv\\ndkjni _com.ntv.ndkjni._test_

 d)  _javah  _com.ntv.ndkjni._test_

 _e) _javah  _com.ntv.ndkjni_ test__

 __f) _javah  _com.ntv.ndkjni_ test_.class-> (error: exception in a thread illegal argument exception)__

I am searching for 5 day. I couldnt find solution. I try different computer. I tried ubuntu and win8, the error still with me.

Thats interesting when I delete the package com.ntv.ndkjni; from java file, then create class file again with javac then javah can create header file succesfully.

__Please help me.
__

__*****************************test.java**************************
__

package com.ntv.ndkjni;

public class test {

static

{

System.loadLibrary("hello");

}

public static native int toplama(int sayi1,int sayi2);

}

__******************************************************************
__

_aaa.PNG
_

This post has been answered by jschellSomeoneStoleMyAlias on Jul 22 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2014
Added on Jul 21 2014
2 comments
8,880 views