# JPL library - running prolong on a Java Application - Error = jpl.fli.Prolog.thread\_self()I

**URL:** <https://swi-prolog.discourse.group/t/jpl-library-running-prolong-on-a-java-application-error-jpl-fli-prolog-thread-self-i/7484>\
**Category:** General\
**Tags:** bug\
**Created:** [May 30, 2024, 11:42pm UTC](https://swi-prolog.discourse.group/t/jpl-library-running-prolong-on-a-java-application-error-jpl-fli-prolog-thread-self-i/7484 "2024-05-30T23:42:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge1981](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jorge1981](https://swi-prolog.discourse.group/u/Jorge1981)\
**Post date:** [May 30, 2024, 11:42pm UTC](https://swi-prolog.discourse.group/t/jpl-library-running-prolong-on-a-java-application-error-jpl-fli-prolog-thread-self-i/7484/1 "2024-05-30T23:42:29Z")

</div>

Hi Dear,  
I have a Java Application (with maven and without maven, both options) which uses  
JPL.jar to run a query on swi-prolog (swipl-9.3.7-1.x64), so swi-prolog is called from an Java Application. I am using Apache Netbeans 21 to run the application. Windows is the OS host, but I also tried it on Linux and I got a similar error. I installed swi-prolog and then I added the environment variables (see screenshots below). I also have JDK 11.  
Variable name: SWI\_HOME\_DIR  
Variable value: C:\Program Files\swipl

Variable: Path  
Value: …SWI\_HOME\_DIR\lib\jpl.jar;M2\_HOME\bin

When I run the application I get the following error:

run:  
Exception in thread “AWT-EventQueue-0” java.lang.UnsatisfiedLinkError: jpl.fli.Prolog.thread\_self()I  
at jpl.fli.Prolog.thread\_self(Native Method)  
at jpl.Query.open(Query.java:302)  
at jpl.Util.textToTerm(Util.java:162)  
at jpl.Query.(Query.java:209)  
at domino1.Domino1.consultar(Domino1.java:157)  
at domino1.Domino1.jButton1ActionPerformed(Domino1.java:92)  
at domino1.Domino1$1.actionPerformed(Domino1.java:50)  
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)  
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)  
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)  
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)  
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)  
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6635)  
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)  
at java.desktop/java.awt.Component.processEvent(Component.java:6400)  
at java.desktop/java.awt.Container.processEvent(Container.java:2263)  
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5011)  
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)  
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)  
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)  
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)  
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)  
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)  
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)  
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4843)  
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)  
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)  
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)  
at java.base/java.security.AccessController.doPrivileged(Native Method)  
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)  
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)  
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)  
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)  
at java.base/java.security.AccessController.doPrivileged(Native Method)  
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)  
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)  
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)  
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)  
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)  
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)  
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)  
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Could you please check and let me know which one could be this issue? I have been working on this for two days now and I am not able to understand why I am getting this error. Or if you know how to customize a linux system (Ubuntu 20.04) to run the same Java App and swi-prolog, it will also be so so helpful.

Thanks so much in advance,  
Best regards,

---

<div class="post-metadata">

**Author:** ![Jorge1981](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jorge1981](https://swi-prolog.discourse.group/u/Jorge1981)\
**Post date:** [May 31, 2024, 6:49pm UTC](https://swi-prolog.discourse.group/t/jpl-library-running-prolong-on-a-java-application-error-jpl-fli-prolog-thread-self-i/7484/2 "2024-05-31T18:49:11Z")

</div>

Hi guys,

I got it working. Just I had compatibility issues. I installed Netbeans 15 with JDK8 (1.8.0) and swi-prolog → swipl-9.3.7-1.x64. JPL.jar I used the one which is coming with the installation of prolog. I imported → import org.jpl7.\*;

Best,
