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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:38:49+00:00 2026-06-13T10:38:49+00:00

I’m developing a JavaFX application which uses a webcam. To be able to access

  • 0

I’m developing a JavaFX application which uses a webcam. To be able to access camera, I was forced to use opencv libraries and javacv which uses native opencv shared libs. Now I want the native dlls to be installed somehow on user machine so that java can use them. I read the whole ant tasks reference for javafx and found an example which is an explanation how to add native system libraries to application package to make it work. I’m using netbeans to build javafx application package. Here is how I’m customizing build.xml file used by netbeans to build app.

 <import file="nbproject/build-impl.xml"/>


<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
   <echo message="Embedding native libraries..."/>
      <fx:jar destfile="${basedir}/build/native-libs-win-x86.jar">
        <fx:fileset dir="${basedir}/natives/windows/x86" includes="*"/>          
      </fx:jar>              
      <fx:jar destfile="${basedir}/build/native-libs-win-x64.jar">
         <fx:fileset dir="${basedir}/natives/windows/x64" includes="*"/>    
      </fx:jar>
   <echo message="Natives embedded..."/>           
</target>
<target name="-post-jfx-deploy" depends="-post-jfx-jar">
   <echo message="deploying ..."/>
     <fx:deploy width="600" height="400"
                outdir="${basedir}/${bundle.outdir}"
                outfile="AppName">
            <fx:info title="AppName"/>
            <fx:application name="${bundle.name}"
                            mainClass="pl.company.project.EntryClass"/>
            <fx:permissions elevated="true"/>
            <fx:resources>

                <fx:fileset dir="dist" includes="*.jar"/>
                <fx:fileset dir="dist/lib" includes="*.jar"/>


                <fx:fileset dir="build" type="native"
                            os="windows" arch="x86"
                            includes="native-libs-win-x86.jar"/>

                <fx:fileset dir="build" type="native"
                            os="windows" arch="x64"
                            includes="native-libs-win-x64.jar"/>

            </fx:resources>
     </fx:deploy>       
</target>   

Now when I execute clean and build in netbeans, I’m getting a folder with set of jars which are my project dependency jars, one jnlp, html, executable jar, and also the two jars which have dll libraries embedded. One jar is native-libs-win-x64.jar and the second is native-libs-win-x86.jar. Native libraries are in top level – so in each jar we have set of dlls and META-INF folder with manifest containing: Manifest-Version: 1.0, Created-By: JavaFX Packager, Main-Class: null

Jnlp file also contains following entries:

 <resources os="windows" arch="x86">    <nativelib href="native-libs-win-x86.jar"/></resources>

and

Now when I start the jnlp, native libraries are not loaded, UnsatisfiedLinkError is raised. But when I unpack jars with dlls into the folder where executable jar, dependencies and jnlp are, everything works like a charm. So my question is.. what am I missing ? I’ve done everything as it was shown in ant task guide on JavaFX documentation pages.

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

    To be specific, and follow rules of stackoverflow, I’m giving details on how I’ve managed to solve my problem:

    Java can be able to load native libraries specified in jnlp descriptor easily but we have to:

    1) Provide correct arch attribute value in resources element- Note that this value is taken from system variable os.arch and its not always x64 on 64 bit architecture or x86 on 32 bit. In my case I have to provide amd64 value.

    2) You jar file pointed by href attribute has to contain all native libraries, and all of them have to be in the top level of jar file.

    3) Also os attribute starts with upper case – for me it doesnt work if I provide is=”windows” it must be os=”Windows”

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.