Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java Native Interface (JNI) - problem with javah to generate header file

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    My Mood
    Amused
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Java Native Interface (JNI) - problem with javah to generate header file

    salam, anyone here know about Java Native Interface (JNI)...it is a tool that function to be as communicator between Java and C/C++ language.....i want ask about generate of header file thats developer must text "javah -jni HelloWorld" in their command prompt...that command will be written after we succesfully created HelloWorld.class that derived from compilation of HelloWorld.java through this command "javac HelloWorld.java"....so, anyone familiar with these things since our company are mastered in Perl, not in Java...i hope i can get something from you all...i already check in internet, they said have problem at classpath....n until now, i dont know how to make classpath correctly...thank you for a reading.. (^_^) ...they said in command prompt that 'javah' is not recognized as an internal or external command, operable program or batch file.. (^_^)


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: Java Native Interface (JNI) - problem with javah to generate header file

    they said in command prompt that 'javah' is not recognized as an internal or external command, operable program or batch file
    The first thing to do is to make sure you have the Java Development Kit downloaded and installed. You will get that message if the javah executable is not on the path. (This has nothing to do with the classpath). The best way to check the configuration of your installation is to write, compile and run a simple HelloWorld program. There are instructions in Oracle's Tutorial (that link assumes you are using Microsoft Windows).

    Towards the bottom of that page their is a link to the Common Problems (and the solutions) page whose first item is the error message to which you refer. It is discussed in the context of not being able to locate the javac executable rather than the javah one, but the principle (and solution) is the same.

    Much of the Tutorial will be of use if you are unfamiliar with Java. Some familiarity is required to use jni as discussed, for instance, in the JNI Technology chapter of Oracle's "Advanced Programming for the Java 2 Platform".

Similar Threads

  1. calling native c code from java using JNI
    By ashok_jeev in forum Java Native Interface
    Replies: 3
    Last Post: November 20th, 2012, 05:28 AM
  2. Java Native Access and arrays
    By p0llux in forum Java Native Interface
    Replies: 0
    Last Post: September 13th, 2011, 01:29 AM
  3. Java web console with Java Native interface
    By rcbandit in forum Java Native Interface
    Replies: 1
    Last Post: August 22nd, 2011, 08:12 AM
  4. How to generate 13 digit numbers to text file
    By duanedtp in forum Java Theory & Questions
    Replies: 3
    Last Post: April 27th, 2011, 11:30 AM
  5. Openning a file in Native Application not Working
    By wagb278 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 8th, 2011, 02:31 PM