0

I'm using XFileDialog (https://code.google.com/p/xfiledialog/) instead of JFileChooser, but I want to bundle the dll's inside the .jar so I don't have to ship them with the application.

So I added them to the project, but I'm not sure how to reference them. Inside XFileDialog.class I found System.loadLibrary("xfiledialog64");

I guess this has to be changed to System.load("xfiledialog64").

Is this correct?

The other issue is that I am not able to edit the .class file from inside Eclipse. Does this mean that I have to edit the .class in the source and then re-compile it?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Omid
  • 823
  • 1
  • 11
  • 31

1 Answers1

3

Since it is apparently a desktop app., one strategy is to launch it using Java Web Start. If launched using web start, the natives would be loaded as they are normally loaded.

Here is the JNLP used to load the applet demo.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>helloapplet</title>
        <vendor>stevpan</vendor>
</information>

    <resources os="Windows" arch="x86">
        <nativelib href="win_x86_dll.jar" />
    </resources>

    <resources os="Windows" arch="amd64">
        <nativelib href="win_x64_dll.jar" />
    </resources>

    <resources>
        <!-- Application Resources -->
        <j2se version="1.6+"
              href="http://java.sun.com/products/autodl/j2se" />
        <jar href="hello.jar" main="true" />
    </resources>

    <applet-desc 
         name="helloapplet"
         main-class="helloapplet"
         width="640"
         height="480">
     </applet-desc>
     <update check="background"/>
</jnlp>                 
Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433