Menu

Using source code

Help
MattW
2005-05-05
2012-09-16
  • MattW

    MattW - 2005-05-05

    Dear Devs,

    Can anyone explain in slightly simpler terms how to use the source code in an IDE. I'm looking for a prolog engine written in java so that I can use it to bind prolog- and java-based tools. I don't need the GUI, so I though the sourc would be most appropriate.

    The instructions in the Readme are really confuding - HELP!

     
    • rafy

      rafy - 2007-09-23

      Hello Sir,
      I tried the APIQueens example in NetBeans5.5.1 and run it. I think it compiles only the class file provides an putput without consulting the "queens.plog" file. There is no "filenotfound" error message. I don't know what to do now. Can you help me please!!

      Sincerely,
      Rafy(rafy_22@yahoo.com)

       
      • Glendon Holst

        Glendon Holst - 2007-09-23

        I am not familiar with the NetBeans IDE, so this is generic advise.

        You'll either need to include the JLog source files, or the .jar files provided with the app package (or the .jar files you compile from the Makefile and the src package).

        For the APIQueens example, you'll need the queens.plog file in the working directory (typically the same directory the example is run from).

        Pass in a argument for the board size (e.g., 8) or the example will ask for it via System.in.

        Step through the APIQueens.main function with the debugger to ensure the returned values are reasonable (e.g., that out, in, is, and result are non-null). If possible, follow the construction of the jPrologAPI to see what value gets read out of the 'in' InputStream. Or add debugging print statements.

        Failing that, try to use the Makefile or Ant build file to create the example, and verify you can get it running (you'll need to build and install from the source -- the installed files, in JLog/JLog should work).

        If you can get APIQueens working with the standard build and install, but not with NetBeans, I'll need more information. What output appears? What size of board did you specify? Was the input stream valid?

        Good luck!

         
        • rafy

          rafy - 2007-09-24

          Thank You very much.
          It worked in NetBeans!!
          I was confusing my input "queens(8,P)." with simply "8."

          Sincerely,
          Rafy.

           
    • Glendon Holst

      Glendon Holst - 2005-06-18

      Hi Matt,

      I think the simplest way to use jPrologAPI in JLog via an IDE is to just include the *.jar files for JLog in the class path for the IDE.

      In XCode (the IDE I usually use) this involves adding the *.jar files to the project.

      The jPrologAPI class is the only one you need to interact with to invoke Prolog code, and you can look at the APIQueens example to see how to do this (plus read the documentation for the jPrologAPI class).

      I would also recommend that if you are using the PrologAPI that you do this with the 1.3.x release, since the API is much improved (because I am using it on another project, it get improvements as warranted).

      The 1.3.x release is a developer release, with only the source provided, so you'll have to compile it first to create the .jar files (use the Makefile to build it). If this is where you're having difficulties let me know. You can also add the JLog source files to your project, just as you add your normal .java source files.

      Good luck!

      Glendon

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.