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

  • Home
  • SEARCH
  • 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 8939163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:46:12+00:00 2026-06-15T10:46:12+00:00

If I have all my .java and .class files in one place (i.e. in

  • 0

If I have all my .java and .class files in one place (i.e. in the default package) then everything is OK and I do all the JNI stuff, etc.
But in this case I have package-ception (lots of directories), my class and Java files are separated in /bin and /src and so on. And I need to generate the header file, but I am getting errors all the time. I tried so many commands, I saw different tutorials. I am already out of options.
So my project is in c://gvk/SEP3 and then the class and Java files with the native methods that I am gonna use are in /bin/CalculatorServer and /src/CalculatorServer

I have all the time run the javah command from the directory where the class file with the native methods is. The commands I tried so far are:

javah -d ./CalculatorServer NativeMethodsCalculator

Error: Could not find class file for ‘NativeMethodsCalculator’.

javah -d ./CalculatorServer CalculatorServer.NativeMethodsCalculator

Error: Could not find class file for ‘CalculatorServer.NativeMethodsCalculator’.

javah -d c://gvk/SEP3/bin/CalculatorServer -classpath c://gvk/SEP3/bin/CalculatorServer NativeMethodsCalculator

Error: Could not find class file for ‘NativeMethodsCalculator’.

javah -classpath c://gvk/SEP3/bin/CalculatorServer -o NativeMethodsCalc.h src.CalculatorServer.NativeMethodsCalculator

Error: Could not find class file for ‘src.CalculatorServer.NativeMethodsCalculator’.

javah -jni bin.CalculatorServer.NativeMethodsCalculator

Error: Could not find class file for ‘bin.CalculatorServer.NativeMethodsCalculator’.

  • 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-15T10:46:13+00:00Added an answer on June 15, 2026 at 10:46 am

    What you didn’t try: go just to /bin/ (not into CalculatorServer) and run

    javah -jni CalculatorServer.NativeMethodsCalculator

    This is the only way how to run it. Just look at the javah doc. It says “fully-qualified-classname” in the synopsis. “Fully qualified” means full classpath. You were giving it only the classname. It worked for you so far only because you were using a default package, which means that your fully qualified classname was equal to a bare classname.

    Option -d and -o doesn’t influence the class lookup, only the storage of native result. All the variants you tried do not make any difference to your mistake.

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

Sidebar

Related Questions

I have a java class containing all the columns of a database table as
I have 4 different Java Projects created in Eclipse. One of them contains all
I have a Java project with all source files in the src folder. This
Possible Duplicate: USD Currency Formatting in Java All- I have a small problem in
On large-scale Java/.Net Enterprise projects, does every developer need to have all the components/libraries/dependencies
Possible Duplicate: ROT-13 function in java? I have to shift all char from a
As you know, in a java interface, all methods have to be defined as
Dear all,Now i have this question in my java program,I think it should be
I have several Java applications. All of them have external jar dependencies and also
I have a Hashtable in Java and want to iterate over all the values

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.