Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8121387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:28:29+00:00 2026-06-06T05:28:29+00:00

I have a simple class for use on JNI, which i need to export

  • 0

I have a simple class for use on JNI, which i need to export to a header file (.h).

I’ve read that I need to use the javah command, by going to the src folder of the project, and type:

javah -jni com.main_package.NativeClass 

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.

I even tried using Eclipse’s external tool for this, as shown here, but it has also shown the same error.

The error I get looks like this:

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.

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.


Here’s the correct answer:

  1. for console , go to the “bin/classes” folder and run the command i’ve used :

    javah -jni com.main_package.NativeClass

  2. for eclipse , use the link i gave , but instead of ${project_loc}/bin/ use ${project_loc}/bin/classes/ , 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 .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:28:31+00:00Added an answer on June 6, 2026 at 5:28 am

    You don’t go to src folder of the project, but the root of your compiled .class files (where com subfolder exists or is created). javah is looking for compiled class, not your source file. If you just run javac manually, the class file will be in the same location as the original sources. Then the statement “go to src folder” is correct. However if you have a project in Eclipse or you use ant or something, the classes might be in completely different location – depending on how your project is set up. I would guess that the Eclipse projects on your Windows and on your Linux are set up differently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple class library that I use in Excel. Here is a
I have a simple class that has a property called executor in which I'd
I have a simple class that I want to use to show a Dialog
I have a simple class that I've added to the components folder called mixpanel.php.
I have a simple Class Hierarchy that I am trying to get to work
I have a simple class that contains some general information about the current web
I have an simple class that I get from a webservice. public class person
I have a simple class with an attribute that can contain a list of
I have written a simple class that works with a UIElement and an action
I have simple class which you can see below: Questions Can I have in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.