# JPL doesn't work on Processing

**URL:** <https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973>\
**Category:** Libraries\
**Created:** [September 30, 2018, 9:03am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973 "2018-09-30T09:03:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Staraven1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Staraven1](https://discourse.processing.org/u/Staraven1)\
**Post date:** [September 30, 2018, 9:03am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/1 "2018-09-30T09:03:56Z")

</div>

I can’t figure out why but JPL (library to use Prolog in Java) doesn’t work on Processing.  
the link I used to download the library :  
[www.java2s.com/Code/Jar/j/Downloadjpljar.htm](http://www.java2s.com/Code/Jar/j/Downloadjpljar.htm)  
and my code is :

```auto
import jpl.fli.*;
import jpl.*;
import java.util.Hashtable;

Atom x = new Atom("test.pl" ); 

Term arg[] = { x } ;

Query q1 = new Query( "consult", arg );
println(q1); 
println( "consult " + (q1.query() ));

```

and I get :  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/5a2fa81f6bdb49ce52d54440f7c729282f8d0bf7.png)  
(I’ve also tried it on my 64 bits computer and the error is the same except replace 64 bits by 32 in the error message)  
What can I do to make it work ? (Or is it a problem with Processing that would need me to do a bug report ? In which case, how do I do ?)  
Thanks in advance for your responses

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [October 1, 2018, 3:25am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/2 "2018-10-01T03:25:38Z")

</div>

Can you tell us where did you place this library after you downloaded it? When you download the file, do you have a jar file? If you do, then do the following:

In your sketch, hit `ctrl+k` if you are using Windows. Alternatively, in the PDE go to \*\*File \>\> Sketchbook \*\* and this will open a folder where your pde file resides. In this folder, create a folder named `code` and then add the jar file (or multiple jar files in case you have more than one) in this folder. Run the sketch and see if it works. It is important to keep in mind that if it doesn’t work, it could be because this file is not compatible with Processing 3, in case it was built using Processing 2.

By the way, what does this library do?

Kf

---

<div class="post-metadata">

**Author:** ![Staraven1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Staraven1](https://discourse.processing.org/u/Staraven1)\
**Post date:** [October 1, 2018, 7:54am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/3 "2018-10-01T07:54:27Z")

</div>

I’ve done what you advise me before creating the topic (and yes, it’s a jar file). I think part of the problem is that it isn’t a processing library. what the library is supposed to do is allowing us to run Prolog queries from Java, Prolog being another programming language.  
I have used the FastMath library before which I thought wasn’t a processing library so I thought that this one would work to… Can it work ?

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [October 2, 2018, 3:57am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/4 "2018-10-02T03:57:44Z")

</div>

If the JPL library works in Java environment, then it should work in Processing as Processing if java after all.

What can Prolog do? More curious than anything else… The more details you provide, the better change you get more answers. I suggest you set a github repo with your code demonstrating your approach.

Kf

---

<div class="post-metadata">

**Author:** ![Staraven1](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Staraven1](https://discourse.processing.org/u/Staraven1)\
**Post date:** [October 2, 2018, 8:44am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/5 "2018-10-02T08:44:05Z")

</div>

Let’s say I have the following Prolog code :

```auto
parent(bob, alice).
parent(bob, charlie).
sibling(X,Y) :- parent(Z,X), parent(Z,Y).

```

I than put in the following in the Prolog console

```auto
sibling(X,Y).

```

The console shows :

```auto
X = alice, Y = charlie ; 
X = charlie, Y = alice

```

(And Prolog also doesn’t have any stack overflow for instance)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 3, 2018, 3:15am UTC](https://discourse.processing.org/t/jpl-doesnt-work-on-processing/3973/6 "2018-10-03T03:15:37Z")

</div>

It sounds like “a library relies on native code that is not available” might mean that JPL has some unmet dependencies – at the system level or in Java 8.

If you run JPL in Java on the same machine, does it work?

…not being a “Processing” library _probably_ should not matter. Projects use lots of libraries that are from the larger Java ecosystem.

…possibly relevant:

[https://github.com/processing/processing-video/issues/90](https://github.com/processing/processing-video/issues/90)

and previously:

[https://github.com/processing/processing/issues/2472](https://github.com/processing/processing/issues/2472)

one possible culprit was non-ascii file paths
