Geertjan's Blog

  • July 23, 2011

NetBeans IDE 7.0 Prolog Editor

Geertjan Wielenga
Product Manager

I created a Prolog Editor for NetBeans IDE 7.0, which meant no more than updating the GeeWhiz Prolog Editor. It provides a few cool features, as can be seen below:

I have also installed the Prolog Editor into other applications on the NetBeans Platform, where it works fine, too. In a NetBeans Platform application, you can also take a JEditorPane and bind it to the "text/x-prolog" MIME type provided by the Prolog Editor, which will enable the syntax coloring to be applied to your JEditorPane.

Get it here. Feedback welcome.

Join the discussion

Comments ( 13 )
  • Jesse Glick Monday, July 25, 2011

    Perhaps the Navigator entries should be named "sift/2", "remove/3", etc., perhaps with subnodes for the cases.

  • guest Tuesday, July 26, 2011


    because we try out tuProlog in a Project for validation and data transfer, the Prolog editor comes in handy and works quite well. There is a bug in the editor with lists in lists like:

    evalRights(Val, [ [Val, Right] | Tail], Default, Right).

    where the ... [Val, Right] ... does seem to break the syntax highlighting/checking. I couldn't find the source code for the recent version of the plugin but only something tagged version "1.5" which seemed to be meant for Netbeans 6.x. Any hints where/how to get it?



  • Geertjan Tuesday, July 26, 2011

    Hi Christoph, get the sources here:


    Feel free to join the project and commit your changes.

  • Sam Joseph Monday, August 22, 2011

    Cool! Not sure this is the right place, but I am getting an error trying to compile my prolog programs in NB 7.0.1:

    Output of running /opt/local/bin/swipl -c /Users/samueljoseph/Code/prolog/TestNBProlog/src/sieve.pro is:

    % library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,928 bytes

    % /Users/samueljoseph/Code/prolog/TestNBProlog/src/sieve.pro compiled 0.01 sec, 3,160 bytes

    % /opt/local/lib/swipl-5.10.4/library/listing compiled into prolog_listing 0.00 sec, 39,472 bytes

    ERROR: '$mark_executable'/1: file `a.out' does not exist (No such file or directory)

    write permissions perhaps ...? I wasn't allowed to add comments to the geewhiz site to submit bug reports ... :-(

  • Chris Wednesday, November 23, 2011

    I noticed that (on NB 701, anyway), the visualization code is broken. I also notice this code seems to use the now-deprecated GLF (I think these are related, since the AST class returns null for its root node because it can no longer import ParserManagerImpl). (I really loved [what I understood of] the idea behind the GLF, but I suppose it was had to get it to perform well??)

    What would it take to update this module? Which APIs should it use instead? I'd be willing to take a stab, but have found that knowing which of the language/parser extension mechanisms is the right one to be difficult to keep up with.

  • Igor Maznitsa Wednesday, December 28, 2011

    Bravo! It is very useful!

  • salaboy Wednesday, January 11, 2012

    Hi Geertjan, this is a really good work!

    I'm hoping to see something similar to support jb oss Rules DRL syntax. Do you think that you can guides us implementing that kind of plug in for NB? I think that with something to start with plus some guidance we can do the rest of the work, the Rules project is getting a lot of attention right now and it will be great to support it.

    Another related questions is the support for BPMN2 models, do you know something about that?


  • guest Sunday, March 4, 2012

    installed this plug-in v2 on NetBeans 7.1, Win 7 64bit, Java 1.6.0_29. Creating a new Prolog files causes an error (missing license file it says) and the View - Show Prolog Diagram does not work (no Prolog file to view it says). The compilations seem to work but how do i run? Run - Run File is greyed out.


  • Timo Friday, March 23, 2012

    Same here, how do I actually RUN the program after compilation?

    Any advice would be greatly appreciated, thanks

  • guest Wednesday, April 25, 2012

    Getting some errors.. Could you provide some more introduction on configuring the plugin please? Would be awesome!

    Output of running "C:\Program Files (x86)\pl\bin\swipl" -c [...]\src\family1.pro is:

    % [...]\src\family1.pro compiled 0.00 sec, 6 clauses

    % autoloading qsave:current_foreign_library/2 from c:/program files (x86)/pl/library/shlib

    % autoloading prolog_autoload:portray_clause/1 from c:/program files (x86)/pl/library/listing

    % autoloading prolog_autoload:clause_info/4 from c:/program files (x86)/pl/library/prolog_clause

    % autoloading prolog_debug:backtrace/1 from c:/program files (x86)/pl/library/prolog_stack

    % autoloading oset:reverse/2 from c:/program files (x86)/pl/library/lists

    % autoloading prolog_autoload:clause_name/2 from c:/program files (x86)/pl/library/prolog_clause

    % Autoloader: iteration 1 resolved 10 predicates and loaded 6 files in 0.062 seconds. Restarting ...

    % Autoloader: loaded 10 files in 2 iterations in 0.078 seconds

    ERROR: '$mark_executable'/1: file `a.out' does not exist (No such file or directory)

  • guest Thursday, May 17, 2012

    when i run my program i have this error

    Error occurred running Prolog compiler. Check options.

    In the main menu go to 'Tools / Options / Miscellaneous / Prolog'.

    Command string is swipl -c C:\Users\user\Documents\NetBeansProjects\NewProject\src\sieve.pro

  • Fukoro Sunday, May 20, 2012

    I have the same probleme, i have the message : Error occurred running Prolog compiler. Check options.

    In the main menu go to 'Tools / Options / Miscellaneous / Prolog'.

    Command string is swipl -c C:\Users\user\Documents\NetBeansProjects\NewProject\src\sieve.pro

  • guest Thursday, July 5, 2012

    In Netbeans 7.2 RC1 Prolog plugin installs fine.

    New Project gives an example of sieve.pro with support files.

    Clicking Run on project produces:

    nt -f "C:\\Documents\\User\\Desktop\\PrologTest" -Dignore.failing.tests=true test


    Deleting: C:\Documents\User\Desktop\PrologTest\build\built-jar.properties


    Updating property file: C:\Documents\User\Desktop\PrologTest\build\built-jar.properties


    Created dir: C:\Documents\User\Desktop\PrologTest\build\test\classes


    Created dir: C:\Documents\User\Desktop\PrologTest\build\test\results

    No tests executed.



    BUILD SUCCESSFUL (total time: 0 seconds)

    Clicking Run produces dialog with message:

    <No main classes found>

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.