Programming in Java with JPL in Eclipse

Status
Not open for further replies.

TieFighter

Baseband Member
Messages
57
Location
La Crosse, WI
JPL is a library that comes with SWI Prolog, which is supposed to be able to give Java an interface to Prolog. I seem to have it installed and running for my windows XP machine (using a provided run.bat file it will compile the example programs and run them correctly). However, when trying to integrate JPL into a project that I am working on in Eclipse, the jpl.Query term cannot be found. JPL IS ABLE to be imported as a class - and I've noted in the example code jpl.Query should also be imported, and have done likewise.

The specific error in Eclipse is:
Access restriction: The constructor Query(String) is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
this shows up wherever I try to create a new Query and where I try to import it. If anyone knows why Eclipse may be giving this error, please help :(
 
Tried, didn't work. I have a feeling I need to be able to install it for eclipse specifically, but w/e I got through the programming, just compiled with a batch file outside of eclipse and ran it that way. I ended up with a nice family album program where I could redefine relationships of family members in my relationships.pl file while the java program was up and running, then hit the refresh button and be able to display all other members of the family that were attached to that one by the new relationship (eg. cousin, brother, sister, uncle, descendant_of), then double click on the listed related person's name to bring up their profile. It was slick and very unique compared to all of my other classmates who used oracle databases or used trees, graphs or ADTs to make relationships.

-by eclipse specific install I mean something like GEMS for eclipse, as I've noted it has a JPL portion that gets installed with the package. I just didn't feel like I had time to deal with all of that.
 
I know it sounds boring, but it's pretty cool. I'll upload a screen shot to illustrate how slick this is:
success.jpg


Just 2 lines of code to define what a cousin is, or an uncle or aunt, and then you can find all of your uncles and aunts and such as long as you know a good amount of who has which father and mother in your family.

Illustrated here is descendant_of which shows your parents, then their parents, and more parents if they are in the album. In this case, it's my son, Vincent showing all of the people he is a descendant_of. Me (Gavin Attoe), my wife (Jessica Attoe), her parents (Cyndy and Walter Lowery), my parents (Ken and Marian Attoe) and my dad's parents (Alfred and Eunice Attoe). Of course, had I added more members it would show 4 sets of grandparents (my dad's parents, mom's parents, my wife's dad's parents, mom's parents) and any of their parents recorded.

This program is really great for navigating your family tree - and like I said, you can click on the name of the listed family member and it will take you to their member profile.

This project was worth 50% of my grade in that class. I ended up with an 'A' for the project (there's a lot of documentation and a help file that goes along with the software). I got a 'B' overall in the class, which isn't bad, considering I bombed my midterm with a 'D', since I missed the classes prior to that with the birth of my daughter, Mina (she's the one being held by Vincent in the picture).
 
Status
Not open for further replies.
Back
Top Bottom