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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:08:18+00:00 2026-06-15T00:08:18+00:00

I have this java method: public static native void processBuffer(ByteBuffer bb); with javah JNIEXPORT

  • 0

I have this java method:

public static native void processBuffer(ByteBuffer bb);

with javah

JNIEXPORT void JNICALL Java_com_lan_factorial_IssmJni_processBuffer
  (JNIEnv *env, jclass klass , jobject buf)

work perfectly

with Jni onload

static JNINativeMethod method_table[] = {
        {"fac"      ,     "(J)J" , (void *) factorial},
        {"getBuffer",     "()[D" , (void *) getBufferNative},
        //{"processBuffer", "(Ljava/nio/ByteBuffer)V", (void *) fillBuffer}};

The others method in this table works, exept the last one which correspond to the method generate from javah above. And of course if I do JNI onload i will have a method call fillBuffer.

Can someone explain why javah works but not jni_onload. Did I do something wrong?
I have other methods using jni_onload so I want to stay away from javah.

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-06-15T00:08:21+00:00Added an answer on June 15, 2026 at 12:08 am

    You have a missing semicolon in the method signature. It doesn’t ‘correspond’ at all. Don’t guess at native method signatures: use the output of javap -s. Cut and paste.

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

Sidebar

Related Questions

i have written a method in java like this public boolean ADD(String ID,String Name,String
Context I have this piece of Java Code btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent
I have a compiled java class: Echo.class public class Echo { public static void
I have an Java class with a static final method getAll: public static final
Why does Java not have a file copy method? This seems like such an
I have this Java code which is used for JSF pagination: public List<ActiveSessionObj> list(int
I have a simple Class package chapter10; public class CompilationTest { public static void
I have this below proram package com; import java.io.PrintStream; import java.net.URL; import java.net.URLConnection; public
I have created simple project with class Main and public static void main and
This sample program is meant to call a native method written in C. Java

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.