2

I'm developing a Java+Prolog application through the JPL bridge. The main application is in Java and it calls the Prolog code using Query.oneSolution("doPrologStuff(here)")

I tried running the GUI debugger/tracer using Query.hasSolution("gtrace") but it throws an exception:

Exception in thread "main" jpl.PrologException: PrologException: error(existence_error(procedure, /(gtrace, 0)), context(:(system, /('$c_call_prolog', 0)), _0))
    at jpl.Query.get1(Query.java:336)
    ...

(Same goes for "guitracer")

Calling gtrace. works well when I run the Prolog code in swipl directly.

When I try Query.hasSolution("trace") it lets me debug the code using the text console, but that's not what I'm looking for. Any ideas how to enable the GUI debugger?

I'm using Eclipse on Ubuntu to develop, but I can try other tools if that helps :)

Daniel
  • 2,728
  • 3
  • 21
  • 33

1 Answers1

0

You need to attach Prolog's graphical environment (xpce). You can do that by loading the file swi('swipl.rc'). The next question is whether or not event dispatching happens. That depends on the setup. If you use the latest 5.11.18/5.10.4 versions, you can set the Prolog flag xpce_threaded to true, which causes SWI-Prolog to run the development tools in their own thread (currently only works on Unix/Linux systems).

Jan
  • 1
  • That doesn't seem to work for me - the file compiles after I call `[swi('swipl.rc')].` but when I call `gtrace.` I get an [endless stream of error messages](http://pastebin.com/t8hXrmzm). I've tested it with version 5.8.2 as this is the version currently in the Ubuntu repositories :) – Daniel Apr 03 '11 at 13:26