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 579445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:22:04+00:00 2026-05-13T14:22:04+00:00

I am currently writing some JNI code to call a class within my JAVA

  • 0

I am currently writing some JNI code to call a class within my JAVA program. I have done this successfully already with static methods within a class.

Currently, when I use:

jclass proc_jclass = env->FindClass("example/io/struct/JavaClass");

It crashes the JVM with:

java.lang.ClassNotFoundException.<init>(Ljava/lang/String;)V+3

I have already tried defining class path locations, to no avail. Any help would be greatly appreciated.

Thanks.

  • 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-05-13T14:22:04+00:00Added an answer on May 13, 2026 at 2:22 pm

    I found the answer myself. The issue was solved by moving the FindClass to directly underneath the JNIEXPORT method. As bmargulies stated it may have been caused by the env pointer being modified. By moving it to the top of the method this was avoided. Looking at the code it still not clear what was causing the problem but ill report back when I find out. In addition top tip use a variable i.e:

    env->FindClass(str_class);
    

    str_class was used to define the ClassPath so that you can quickly test what classes are accessible without re-compliing. – I know its obvious, but does save time when debugging.

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

Sidebar

Related Questions

I'm currently writing a java program that requires some Data to run. The data
I'm currently writing some code where I have something along the lines of: double
I have used Rhino.Mocks extensively currently writing some tests in Java using EasyMocks. However
I'm currently learning assembler and writing some program in real mode. I have some
I am writing some c# code that is currently supposed to run as fast
i'm currently writing on some piece of code in android 2.1 that is supposed
I was writing some native code on Android using NDK(jni). I want to turn
I'm currently writing some code for UnconstrainedMelody which has generic methods to do with
I'm currently writing a code in VBA to retrieve prices for some financial models.
I am currently writing some code that can access a separate workbook through an

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.