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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:48:51+00:00 2026-05-10T18:48:51+00:00

I’m working on a configuration script for a JNI wrapper. One of the configuration

  • 0

I’m working on a configuration script for a JNI wrapper. One of the configuration parameters is the path to jni.h. What’s a good quick-and-dirty Autoconf test for whether this parameter is set correctly for C++ compilation? You can assume you’re running on Linux and g++ is available.

Alternatively, is there a way to get javah (or a supporting tool) to give me this path directly?

  • 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. 2026-05-10T18:48:51+00:00Added an answer on May 10, 2026 at 6:48 pm

    Checking for headers is easy; just use AC_CHECK_HEADER. If it’s in a weird place (i.e., one the compiler doesn’t know about), it’s entirely reasonable to expect users to set CPPFLAGS.

    The hard part is actually locating libjvm. You typically don’t want to link with this; but you may want to default to a location to dlopen it from if JAVA_HOME is not set at run time.

    But I don’t have a better solution than requiring that JAVA_HOME be set at configure time. There’s just too much variation in how this stuff is deployed across various OSes (even just Linux distributions). This is what I do:

    AC_CHECK_HEADER([jni.h], [have_jni=yes]) AC_ARG_VAR([JAVA_HOME], [Java Runtime Environment (JRE) location]) AC_ARG_ENABLE([java-feature],               [AC_HELP_STRING([--disable-java-feature],                               [disable Java feature])]) case $target_cpu in      x86_64) JVM_ARCH=amd64 ;;      i?86)   JVM_ARCH=i386 ;;      *)      JVM_ARCH=$target_cpu ;; esac AC_SUBST([JVM_ARCH]) AS_IF([test X$enable_java_feature != Xno], [AS_IF([test X$have_jni != Xyes],        [AC_MSG_FAILURE([The Java Native Interface is required for Java feature.])]) AS_IF([test -z '$JAVA_HOME'], [AC_MSG_WARN([JAVA_HOME has not been set.  JAVA_HOME must be set at run time to locate libjvm.])], [save_LDFLAGS=$LDFLAGS LDFLAGS='-L$JAVA_HOME/lib/$JVM_ARCH/client -L$JAVA_HOME/lib/$JVM_ARCH/server $LDFLAGS' AC_CHECK_LIB([jvm], [JNI_CreateJavaVM], [LIBS=$LIBS],              [AC_MSG_WARN([no libjvm found at JAVA_HOME])]) LDFLAGS=$save_LDFLAGS ])]) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.