IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Java prolog JPL


Sujet :

Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 11
    Par défaut Java prolog JPL
    je suis entrain de faire la connexion entre java et prolog. J'ai installe swi prolog nouvelle version qui inclut le JPL.jar mais le probleme que j'ai le met dans le class path mais j'ai recu toujours cette erreur.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    in thread "main" java.lang.UnsatisfiedLinkError: no jpl in java.library.path
    	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    	at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    	at java.lang.System.loadLibrary(System.java:993)
    	at jpl.fli.Prolog.<clinit>(Prolog.java:82)
    	at jpl.Query.open(Query.java:305)
    	at jpl.Util.textToTerm(Util.java:162)
    	at jpl.Query.<init>(Query.java:210)
    	at dadax.Test.test_0(Test.java:71)
    	at dadax.Test.run_tests(Test.java:49)
    	at dadax.Test.main(Test.java:43)
    Merci pour votre aide

  2. #2
    Membre Expert

    Profil pro
    imposteur
    Inscrit en
    Avril 2003
    Messages
    3 308
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : imposteur

    Informations forums :
    Inscription : Avril 2003
    Messages : 3 308
    Par défaut
    J'ai exactement le même problème, et je serais ravi d'avoir un coup de main.

  3. #3
    Membre Expert

    Profil pro
    imposteur
    Inscrit en
    Avril 2003
    Messages
    3 308
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : imposteur

    Informations forums :
    Inscription : Avril 2003
    Messages : 3 308
    Par défaut
    J'ai trouvé la solution sous linux :

    il y a un paquet de fichiers (*.so) dans le répertoire jpl/lib/i366-linux, il faut les copier dans /usr/lib.
    Me demande pourquoi c'est pas fait automatiquement à l'install de SWI, m'enfin bon...

  4. #4
    Expert éminent
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Billets dans le blog
    1
    Par défaut
    Salut,

    Citation Envoyé par Eusebius Voir le message
    il y a un paquet de fichiers (*.so) dans le répertoire jpl/lib/i366-linux, il faut les copier dans /usr/lib.
    Le principe est le même sous tous les systèmes, il que les librairies natives soit disponible pour la JVM. Pour cela il y a principalement deux solutions :
    • Les copier dans un répertoire système (/usr/lib, c:\windows\system32, etc.).
    • Ajouter le répertoire qui les contient dans le PATH.


    On peut également modifier la propriété "java.library.path" mais je le déconseille...

    Pour info les librairies se nomment *.dll sous Windows et lib*.so sous Unix/Linux.
    Dans ce cas c'est la librairie jpl qui était introuvable, et donc le fichier jpl.dll sous Windows ou libjpl.so sous Linux/Unix...

    a++

  5. #5
    Membre confirmé Avatar de ludo86
    Homme Profil pro
    Développement applications iOS/android
    Inscrit en
    Avril 2007
    Messages
    93
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Développement applications iOS/android
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 93
    Par défaut
    Je relance le topic avec un problème similaire. J'a donc moi aussi un fichier prolog que je souhaite faire fonctionnner sous java.

    J'ai bien transféré les *.dll (jpl.dll et libpl.dll) dans le dossier C:\WINDOWS\system32, dans le build path j'ai bien inclus pl.jar, cependant j'ai toujours les erreurs suivantes :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
     
     
    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: C:\WINDOWS\system32\jpl.dll: Can't find dependent libraries
    	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    	at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    	at java.lang.ClassLoader.loadLibrary(Unknown Source)
    	at java.lang.Runtime.loadLibrary0(Unknown Source)
    	at java.lang.System.loadLibrary(Unknown Source)
    	at jpl.fli.Prolog.<clinit>(Prolog.java:82)
    	at jpl.Query.open(Query.java:283)
    	at jpl.Util.textToTerm(Util.java:162)
    	at jpl.Query.Query1(Query.java:183)
    	at jpl.Query.<init>(Query.java:176)
    	at ascesseurProlog.Requete.<init>(Requete.java:16)
    	at verificateur.verificateurSynthaxe.isSentenceCorrect(verificateurSynthaxe.java:60)
    	at fenetrePrincipale.calculatrice.actionPerformed(calculatrice.java:55)
    	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    	at java.awt.Component.processMouseEvent(Unknown Source)
    	at javax.swing.JComponent.processMouseEvent(Unknown Source)
    	at java.awt.Component.processEvent(Unknown Source)
    	at java.awt.Container.processEvent(Unknown Source)
    	at java.awt.Component.dispatchEventImpl(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    	at java.awt.Container.dispatchEventImpl(Unknown Source)
    	at java.awt.Window.dispatchEventImpl(Unknown Source)
    	at java.awt.Component.dispatchEvent(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Voici comment je procéde pour accéder au prolog :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
     
     
    package ascesseurProlog;
     
    import jpl.*;
    import java.awt.*;
    import java.lang.*;
    import java.util.Hashtable; 
     
    public class Requete 
    {
    	protected Query query;
     
    	public Requete(String sentence)
    	{
    		query = new Query(
    		        "child_of",
    		        new Term[] {new Atom("joe"),new Atom("ralf")}
    		    );
     
    		System.out.println(
    			    "child_of(joe,ralf) is " +
    			    ( query.query() ? "provable" : "not provable" )
    			);
    	}
    }
    Le code prolog

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
     
    child_of(joe, ralf).
    child_of(mary, joe).
    child_of(steve, joe).
     
    descendent_of(X, Y) :-
            child_of(X, Y).
    descendent_of(X, Y) :-
            child_of(Z, Y),
    		descendent_of(X, Z).

  6. #6
    Membre chevronné Avatar de srvremi
    Homme Profil pro
    Directeur d'école d'ingénieurs
    Inscrit en
    Mars 2002
    Messages
    554
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Directeur d'école d'ingénieurs
    Secteur : Enseignement

    Informations forums :
    Inscription : Mars 2002
    Messages : 554
    Par défaut
    Salut.

    Je fais un petit up parce que je deviens fou. Je ne trouve pas où télécharger le fichier jpl.jar Il n'est pas installé avec ma version de SWI-Prolog sous Ubuntu, et pas moyen de trouver un paquet qui le contiendrait.

    Si quelqu'un pouvait m'aider ce serait chic

    @+
    Rémi

Discussions similaires

  1. jpl: communication with prolog from java
    Par odysseus dans le forum Général Java
    Réponses: 0
    Dernier message: 20/01/2010, 15h29
  2. Réponses: 5
    Dernier message: 14/05/2008, 18h14
  3. Java & Prolog encore
    Par Fredd_b dans le forum Prolog
    Réponses: 1
    Dernier message: 22/05/2006, 00h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo