Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing javah on linux
    primarykey
    data
    text
    <p>I have a simple class for use on JNI, which i need to export to a header file (.h).</p> <p>I've read that I need to use the <code>javah</code> command, by going to the <code>src</code> folder of the project, and type:</p> <pre><code>javah -jni com.main_package.NativeClass </code></pre> <p>On windows it works fine, but on my main OS (Linux) it doesn't. It keeps telling that it can't find the class. I've tried to use many combinations of the command and to run it on many possible paths, but it didn't work. I've followed many tutorials and websites (including here) and tried their combinations too.</p> <p>I even tried using Eclipse's external tool for this, as shown <a href="https://stackoverflow.com/questions/3451378/how-to-run-javah-from-eclipse">here</a>, but it has also shown the same error.</p> <p>The error I get looks like this:</p> <pre><code>error: cannot access com.main_package.NativeClass class file for com.main_package.NativeClass not found javadoc: error - Class com.main_package.NativeClass not found. Error: No classes were specified on the command line. Try -help. </code></pre> <p>Can anyone please help me? I really like working on Linux and wouldn't want to switch OS each time i need to use this tool.</p> <hr> <p>Here's the correct answer:</p> <ol> <li><p>for console , go to the "bin/classes" folder and run the command i've used :</p> <p>javah -jni com.main_package.NativeClass </p></li> <li><p>for eclipse , use the link i gave , but instead of <code>${project_loc}/bin/</code> use <code>${project_loc}/bin/classes/</code> , and then , in the package explorer , go to the NativeClass.java , and run the external tool . the output will be in the same path as of the java file . </p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload