@Tamara I looked inside jpl.jar and I guess you should use package org.jpl7 instead of just jpl.

Here is a piece of code that worked for me:
import org.jpl7.JPL;
import org.jpl7.Query;
import org.jpl7.Term;
public class PrologApp {
public static void main(String[] args) {
Query.hasSolution("use_module(library(jpl))"); // only because we call e.g. jpl_pl_syntax/1 below
Term swi = Query.oneSolution("current_prolog_flag(version_data,Swi)").get("Swi");
System.out.println("swipl.version = " + swi.arg(1) + "." + swi.arg(2) + "." + swi.arg(3));
System.out.println("swipl.syntax = " + Query.oneSolution("jpl_pl_syntax(Syntax)").get("Syntax"));
System.out.println("swipl.home = " + Query.oneSolution("current_prolog_flag(home,Home)").get("Home").name());
System.out.println("jpl.jar = " + JPL.version_string());
System.out.println("jpl.dll = " + org.jpl7.fli.Prolog.get_c_lib_version());
System.out.println("jpl.pl = " + Query.oneSolution("jpl_pl_lib_version(V)").get("V").name());
}
}
And output:
swipl.version = 7.2.3
swipl.syntax = modern
swipl.home = /usr/lib/swi-prolog
jpl.jar = 7.0.1-alpha
jpl.dll = 7.0.1-alpha
jpl.pl = 7.0.1-alpha
Check here for more examples https://github.com/SWI-Prolog/packages-jpl/tree/master/examples/java