Configure: reuse the same Java class to check 53/17453/3
Clément DAVID [Fri, 13 Nov 2015 08:36:45 +0000 (09:36 +0100)]
This avoid the compilation time + execution foreach (java class * classpath
dir). It slightly improves the configure time for JAR dependencies.

On my machine, `time ./configure` returns :
 1m22.301s before
 0m29.333s after

Change-Id: I5ad28debb9d608367b9635f87ad613cded87ccdd

scilab/configure
scilab/configure.ac
scilab/m4/docbook.m4
scilab/m4/java-thirdparty.m4

index 9619768..3470ea1 100755 (executable)
@@ -804,8 +804,8 @@ COMMONS_IO
 BATIK
 FREEHEP_UTIL
 FREEHEP_IO
-FREEHEP_GRAPHICSIO
 FREEHEP_GRAPHICSIO_EMF
+FREEHEP_GRAPHICSIO
 FREEHEP_GRAPHICS2D
 FOP
 JEUCLID_CORE
                 if test "$with_xcos" != no; then
                    # jgraphx
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jgraphx" >&5
-$as_echo_n "checking jgraphx... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jgraphx.jar" "$jardir/libjgraphx.jar" "$jardir/libjgraphx-java.jar" "$jardir/jgraphx*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 13590 "configure"
+    cat << \EOF > conftestSharedChecker.java
+// #line 13575 "configure"
 import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
-import com.mxgraph.model.mxCell;
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
 
-public class conftest {
-    public static void main(String[] argv) {
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
+    fi
 
 
-            fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.model.mxCell)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.model.mxCell)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.model.mxCell)" "$LINENO" 5
-      fi
-    fi
 
-                   JGRAPHX=$PACKAGE_JAR_FILE
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jgraphx" >&5
+$as_echo_n "checking jgraphx... " >&6; }
+    PACKAGE_JAR_FILE=
 
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jgraphx.jar' -or -name 'libjgraphx.jar' -or -name 'libjgraphx-java.jar' -or -name 'jgraphx*.jar' \) -printf '%p:' 2>/dev/null)."
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (2.0.0.1) of jgraphx" >&5
-$as_echo_n "checking minimal version (2.0.0.1) of jgraphx... " >&6; }
-   saved_ac_java_classpath=$ac_java_classpath
-   export ac_java_classpath="$JGRAPHX:$ac_java_classpath"
-   if test "x" == "x"; then
+    if test ! -f conftestSharedChecker.class ; then
 
-    cat << \EOF > conftest.java
-// #line 13697 "configure"
+    cat << \EOF > conftestSharedChecker.java
+// #line 13764 "configure"
 import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
-import com.mxgraph.view.mxGraph;
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
 
-public class conftest {
-    public static void main(String[] argv) {
-        String minVersion="2.0.0.1";
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-                            System.out.println(mxGraph.VERSION);
-                                  if (compare(minVersion, mxGraph.VERSION) > 0) {
-                                   System.exit(-1);
-                                }
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-    }
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
+        System.out.println(path);
     }
 
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
         }
-        return sb.toString();
     }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jgraphx. Expected at least 2.0.0.1. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jgraphx. Expected at least 2.0.0.1. Found $STDOUT" "$LINENO" 5
-            fi
-
-   else
-
-    cat << \EOF > conftest.java
-// #line 13769 "configure"
-import java.util.regex.Pattern;
-
-import com.mxgraph.view.mxGraph;
-
-public class conftest {
-    public static void main(String[] argv) {
-        String minVersion="2.0.0.1";
-
-                            System.out.println(mxGraph.VERSION);
-                                  if (compare(minVersion, mxGraph.VERSION) != 0) {
-                                   System.exit(-1);
-                                }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jgraphx. Expected exact version 2.0.0.1. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jgraphx. Expected exact version 2.0.0.1. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
 
     fi
-   ac_java_classpath=$saved_ac_java_classpath
 
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jgraphx com.mxgraph.view.mxGraph $jar_resolved VERSION 2.0.0.1 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.view.mxGraph)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.view.mxGraph)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar jgraphx used by Diagram design (looking for package com.mxgraph.view.mxGraph)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                   JGRAPHX=$PACKAGE_JAR_FILE
 
                 fi
 
                 if test "$with_external_scirenderer" = yes; then
                    # scirenderer
 
+
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking scirenderer" >&5
 $as_echo_n "checking scirenderer... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/scirenderer.jar" "$jardir/libscirenderer.jar" "$jardir/libscirenderer-java.jar" "$jardir/scirenderer*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 13863 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.scilab.forge.scirenderer.PackageInfo;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'scirenderer.jar' -or -name 'libscirenderer.jar' -or -name 'libscirenderer-java.jar' -or -name 'scirenderer*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 13985 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
@@ -13893,59 +14148,28 @@ EOF
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker scirenderer org.scilab.forge.scirenderer.PackageInfo $jar_resolved VERSION 1.1.0 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
@@ -13955,37 +14179,182 @@ $as_echo "$as_me: WARNING: Could not find or use the Java package/jar scirendere
           as_fn_error $? "Could not find or use the Java package/jar scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
                    SCIRENDERER=$PACKAGE_JAR_FILE
                    SCIRENDERER_CP=$PACKAGE_JAR_FILE
+                 else
+                   echo "Use external version of scirenderer"
+                   # Use the scirenderer in Scilab sources
+                   SCIRENDERER="\${modules.dir}/scirenderer/\${build.jar.dir}/scirenderer.jar"
+                   SCIRENDERER_CP="\$SCILAB/modules/scirenderer/jar/scirenderer.jar"
+                fi
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.1.0) of scirenderer" >&5
-$as_echo_n "checking minimal version (1.1.0) of scirenderer... " >&6; }
-   saved_ac_java_classpath=$ac_java_classpath
-   export ac_java_classpath="$SCIRENDERER:$ac_java_classpath"
-   if test "x" == "x"; then
-
-    cat << \EOF > conftest.java
-// #line 13970 "configure"
-import java.util.regex.Pattern;
-
-import org.scilab.forge.scirenderer.PackageInfo;
 
-public class conftest {
+               # Docking system
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking flexdock" >&5
+$as_echo_n "checking flexdock... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'flexdock.jar' -or -name 'libflexdock.jar' -or -name 'libflexdock-java.jar' -or -name 'flexdock*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 14212 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.1.0";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-                            System.out.println(PackageInfo.VERSION);
-                                  if (compare(minVersion, PackageInfo.VERSION) > 0) {
-                                   System.exit(-1);
-                                }
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of scirenderer. Expected at least 1.1.0. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of scirenderer. Expected at least 1.1.0. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
 
-   else
+    fi
 
-    cat << \EOF > conftest.java
-// #line 14042 "configure"
-import java.util.regex.Pattern;
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker flexdock org.flexdock.util.Utilities $jar_resolved VERSION 1.2.4 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.util.Utilities)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.util.Utilities)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.util.Utilities)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                FLEXDOCK=$PACKAGE_JAR_FILE
 
-import org.scilab.forge.scirenderer.PackageInfo;
 
-public class conftest {
+                # Swing look&feel implementations
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking looks" >&5
+$as_echo_n "checking looks... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'looks.jar' -or -name 'liblooks.jar' -or -name 'liblooks-java.jar' -or -name 'looks*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 14431 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.1.0";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-                            System.out.println(PackageInfo.VERSION);
-                                  if (compare(minVersion, PackageInfo.VERSION) != 0) {
-                                   System.exit(-1);
-                                }
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of scirenderer. Expected exact version 1.1.0. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of scirenderer. Expected exact version 1.1.0. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
 
     fi
-   ac_java_classpath=$saved_ac_java_classpath
 
-                 else
-                   echo "Use external version of scirenderer"
-                   # Use the scirenderer in Scilab sources
-                   SCIRENDERER="\${modules.dir}/scirenderer/\${build.jar.dir}/scirenderer.jar"
-                   SCIRENDERER_CP="\$SCILAB/modules/scirenderer/jar/scirenderer.jar"
-                fi
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker looks com.jgoodies.looks.common.MenuItemRenderer $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test ""yes"" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                LOOKS=$PACKAGE_JAR_FILE
 
+                # Named differently under ArchLinux or Fedora
+                if test -z "$LOOKS"; then
 
 
-               # Docking system
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking flexdock" >&5
-$as_echo_n "checking flexdock... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jgoodies-looks" >&5
+$as_echo_n "checking jgoodies-looks... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/flexdock.jar" "$jardir/libflexdock.jar" "$jardir/libflexdock-java.jar" "$jardir/flexdock*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 14141 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.flexdock.docking.DockingManager;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jgoodies-looks.jar' -or -name 'libjgoodies-looks.jar' -or -name 'libjgoodies-looks-java.jar' -or -name 'jgoodies-looks*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 14650 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jgoodies-looks com.jgoodies.looks.common.MenuItemRenderer $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.docking.DockingManager)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.docking.DockingManager)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar flexdock used by Scilab Gui (looking for package org.flexdock.docking.DockingManager)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                FLEXDOCK=$PACKAGE_JAR_FILE
+                    LOOKS=$PACKAGE_JAR_FILE
+                fi
 
 
+                #  Skin Look and Feel
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.2.4) of flexdock" >&5
-$as_echo_n "checking minimal version (1.2.4) of flexdock... " >&6; }
-   saved_ac_java_classpath=$ac_java_classpath
-   export ac_java_classpath="$FLEXDOCK:$ac_java_classpath"
-   if test "x" == "x"; then
 
-    cat << \EOF > conftest.java
-// #line 14248 "configure"
-import java.util.regex.Pattern;
 
-import org.flexdock.util.Utilities;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking skinlf" >&5
+$as_echo_n "checking skinlf... " >&6; }
+    PACKAGE_JAR_FILE=
 
-public class conftest {
-    public static void main(String[] argv) {
-        String minVersion="1.2.4";
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-                            System.out.println(Utilities.VERSION);
-                                  if (compare(minVersion, Utilities.VERSION) > 0) {
-                                   System.exit(-1);
-                                }
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'skinlf.jar' -or -name 'libskinlf.jar' -or -name 'libskinlf-java.jar' -or -name 'skinlf*.jar' \) -printf '%p:' 2>/dev/null)."
 
-    }
+    if test ! -f conftestSharedChecker.class ; then
 
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
+    cat << \EOF > conftestSharedChecker.java
+// #line 14870 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
+    }
+
+    private static int compare(String v1, String v2) {
+        String s1 = normalisedVersion(v1);
+        String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of flexdock. Expected at least 1.2.4. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of flexdock. Expected at least 1.2.4. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
 
-   else
+    fi
 
-    cat << \EOF > conftest.java
-// #line 14320 "configure"
-import java.util.regex.Pattern;
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker skinlf com.l2fprod.util.AccessUtils $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-import org.flexdock.util.Utilities;
+                SKINLF=$PACKAGE_JAR_FILE
 
-public class conftest {
+
+                # JOGL 2
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jogl2" >&5
+$as_echo_n "checking jogl2... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jogl2.jar' -or -name 'libjogl2.jar' -or -name 'libjogl2-java.jar' -or -name 'jogl2*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 15089 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.2.4";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-                            System.out.println(Utilities.VERSION);
-                                  if (compare(minVersion, Utilities.VERSION) != 0) {
-                                   System.exit(-1);
-                                }
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
@@ -14356,66 +15252,70 @@ EOF
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of flexdock. Expected exact version 1.2.4. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of flexdock. Expected exact version 1.2.4. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
+
+    fi
 
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jogl2 javax.media.opengl.glu.GLUnurbs $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
     fi
-   ac_java_classpath=$saved_ac_java_classpath
 
+                JOGL2=$PACKAGE_JAR_FILE
 
-                # Swing look&feel implementations
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking looks" >&5
-$as_echo_n "checking looks... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/looks.jar" "$jardir/liblooks.jar" "$jardir/liblooks-java.jar" "$jardir/looks*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (Specification-Version 2.2) of jogl2" >&5
+$as_echo_n "checking minimal version (Specification-Version 2.2) of jogl2... " >&6; }
+    export JARFILE=$JOGL2;
+    if test "x" == "x"; then
 
     cat << \EOF > conftest.java
-// #line 14411 "configure"
+// #line 15300 "configure"
 import java.util.regex.Pattern;
 
-import com.jgoodies.looks.common.MenuItemRenderer;
+import java.io.IOException;
+import java.util.jar.JarFile;
 
 public class conftest {
     public static void main(String[] argv) {
-
+        String minVersion="2.2";
+        try {
+            String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
+            System.out.println(version);
+            if (compare(minVersion, version) > 0) {
+                System.exit(-1);
+            }
+        } catch (IOException e) {
+            System.err.println(e.getMessage());
+            System.exit(1);
+        }
     }
 
     private static int compare(String v1, String v2) {
@@ -14443,26 +15343,14 @@ EOF
     export CLASSPATH
     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
     if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
+       if test ""yes"" = "no"; then
            echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
+              echo "yes"
        else
               cmd="$JAVA conftest"
               if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
                echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
+                  echo "yes"
             else
                 echo "configure: failed program was:" >&5
                 cat conftest.java >&5
@@ -14470,10 +15358,7 @@ $as_echo "$jar_resolved" >&6; }
                    STDOUT=`cat conftest.java.output`
                 fi
                 echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
+                  as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
                             fi
         fi
         if test -f conftest.java.output; then
@@ -14483,56 +15368,31 @@ $as_echo "$jar_resolved" >&6; }
         echo "configure: failed program was:" >&5
         cat conftest.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
+          as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
             fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test ""yes"" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" "$LINENO" 5
-      fi
-    fi
-
-                LOOKS=$PACKAGE_JAR_FILE
-
-                # Named differently under ArchLinux or Fedora
-                if test -z "$LOOKS"; then
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jgoodies-looks" >&5
-$as_echo_n "checking jgoodies-looks... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jgoodies-looks.jar" "$jardir/libjgoodies-looks.jar" "$jardir/libjgoodies-looks-java.jar" "$jardir/jgoodies-looks*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+    else
 
     cat << \EOF > conftest.java
-// #line 14528 "configure"
+// #line 15377 "configure"
 import java.util.regex.Pattern;
 
-import com.jgoodies.looks.common.MenuItemRenderer;
+import java.io.IOException;
+import java.util.jar.JarFile;
 
 public class conftest {
     public static void main(String[] argv) {
-
+        String minVersion="2.2";
+        try {
+            String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
+            System.out.println("Specification-Version" + ": " + version);
+            if (compare(minVersion, version) != 0) {
+                System.exit(-1);
+            }
+        } catch (IOException e) {
+            System.err.println(e.getMessage());
+            System.exit(1);
+        }
     }
 
     private static int compare(String v1, String v2) {
@@ -14560,26 +15420,14 @@ EOF
     export CLASSPATH
     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
     if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
+       if test ""yes"" = "no"; then
            echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
+              echo "yes"
        else
               cmd="$JAVA conftest"
               if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
                echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
+                  echo "yes"
             else
                 echo "configure: failed program was:" >&5
                 cat conftest.java >&5
@@ -14587,10 +15435,7 @@ $as_echo "$jar_resolved" >&6; }
                    STDOUT=`cat conftest.java.output`
                 fi
                 echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
+                  as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
                             fi
         fi
         if test -f conftest.java.output; then
@@ -14600,1203 +15445,280 @@ $as_echo "$jar_resolved" >&6; }
         echo "configure: failed program was:" >&5
         cat conftest.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
+          as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
             fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jgoodies-looks used by Scilab Gui - Look and feel (looking for package com.jgoodies.looks.common.MenuItemRenderer)" "$LINENO" 5
-      fi
     fi
-
-                    LOOKS=$PACKAGE_JAR_FILE
-                fi
+    unset JARFILE
 
 
-                #  Skin Look and Feel
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking skinlf" >&5
-$as_echo_n "checking skinlf... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/skinlf.jar" "$jardir/libskinlf.jar" "$jardir/libskinlf-java.jar" "$jardir/skinlf*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 14646 "configure"
-import java.util.regex.Pattern;
-
-import com.l2fprod.util.AccessUtils;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar skinlf used by Scilab Gui - Skin Look and Feel (looking for package com.l2fprod.util.AccessUtils)" "$LINENO" 5
-      fi
-    fi
-
-                SKINLF=$PACKAGE_JAR_FILE
-
-
-                # JOGL 2
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jogl2" >&5
-$as_echo_n "checking jogl2... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jogl2.jar" "$jardir/libjogl2.jar" "$jardir/libjogl2-java.jar" "$jardir/jogl2*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 14763 "configure"
-import java.util.regex.Pattern;
-
-import javax.media.opengl.glu.GLUnurbs;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jogl2 used by Scilab 3D rendering - Version 2.0 (looking for package javax.media.opengl.glu.GLUnurbs)" "$LINENO" 5
-      fi
-    fi
-
-                JOGL2=$PACKAGE_JAR_FILE
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (Specification-Version 2.2) of jogl2" >&5
-$as_echo_n "checking minimal version (Specification-Version 2.2) of jogl2... " >&6; }
-    export JARFILE=$JOGL2;
-    if test "x" == "x"; then
-
-    cat << \EOF > conftest.java
-// #line 14869 "configure"
-import java.util.regex.Pattern;
-
-import java.io.IOException;
-import java.util.jar.JarFile;
-
-public class conftest {
-    public static void main(String[] argv) {
-        String minVersion="2.2";
-        try {
-            String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
-            System.out.println(version);
-            if (compare(minVersion, version) > 0) {
-                System.exit(-1);
-            }
-        } catch (IOException e) {
-            System.err.println(e.getMessage());
-            System.exit(1);
-        }
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
-            fi
-
-    else
-
-    cat << \EOF > conftest.java
-// #line 14946 "configure"
-import java.util.regex.Pattern;
-
-import java.io.IOException;
-import java.util.jar.JarFile;
-
-public class conftest {
-    public static void main(String[] argv) {
-        String minVersion="2.2";
-        try {
-            String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
-            System.out.println("Specification-Version" + ": " + version);
-            if (compare(minVersion, version) != 0) {
-                System.exit(-1);
-            }
-        } catch (IOException e) {
-            System.err.println(e.getMessage());
-            System.exit(1);
-        }
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
-            fi
-
-    fi
-    unset JARFILE
-
-
-                if test "$MACOSX" = 1; then
-                   echo "Check of the presence of libjogl.jnilib and libjogl_awt.jnilib disabled under Mac OS X"
-                else
-                   LDFLAGS_save=$LDFLAGS
-                   # Provide known paths where distribs/OS can store JNI libs
-                   LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
-                   LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
-                   LDFLAGS="$LDFLAGS -L/usr/lib/jogl2 -L/usr/lib64/jogl2"               # RedHat
-                   LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
-                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glTexParameterf in -ljogl_desktop" >&5
-$as_echo_n "checking for glTexParameterf in -ljogl_desktop... " >&6; }
-if ${ac_cv_lib_jogl_desktop_glTexParameterf+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljogl_desktop  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char glTexParameterf ();
-int
-main ()
-{
-return glTexParameterf ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_jogl_desktop_glTexParameterf=yes
-else
-  ac_cv_lib_jogl_desktop_glTexParameterf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jogl_desktop_glTexParameterf" >&5
-$as_echo "$ac_cv_lib_jogl_desktop_glTexParameterf" >&6; }
-if test "x$ac_cv_lib_jogl_desktop_glTexParameterf" = xyes; then :
-  JOGL2_LIBS="-ljogl_desktop"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not link against -ljogl_desktop. Will try against -ljogl_desktop -lGL" >&5
-$as_echo "$as_me: WARNING: Could not link against -ljogl_desktop. Will try against -ljogl_desktop -lGL" >&2;}
-fi
-
-                   if test -z "$JOGL2_LIBS"; then # The previous test failed add more options to the LDFLAGS
-                       # the space after "jogl" in the following line is on
-                       # purpose to disable the cache
-                          as_ac_Lib=`$as_echo "ac_cv_lib_jogl_desktop ''_glTexParameterf" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glTexParameterf in -ljogl_desktop " >&5
-$as_echo_n "checking for glTexParameterf in -ljogl_desktop ... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljogl_desktop  -lGL $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char glTexParameterf ();
-int
-main ()
-{
-return glTexParameterf ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-eval ac_res=\$$as_ac_Lib
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  JOGL2_LIBS="-ljogl_desktop -lGL"
-else
-  as_fn_error $? "\"libjogl: Library
-missing (Cannot find symbol glTexParameterf). Check if libjogl - C/Java (JNI)
-interface for JOGL2 - or libGL (OpenGL library) are installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries.\"" "$LINENO" 5
-fi
-
-                   fi
-
-                   LDFLAGS=$LDFLAGS_save
-                fi
-
-                # JoGL Native <=> Java connector
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking gluegen2-rt" >&5
-$as_echo_n "checking gluegen2-rt... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/gluegen2-rt.jar" "$jardir/libgluegen2-rt.jar" "$jardir/libgluegen2-rt-java.jar" "$jardir/gluegen2-rt*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 15148 "configure"
-import java.util.regex.Pattern;
-
-import jogamp.common.os.MachineDescriptionRuntime;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" "$LINENO" 5
-      fi
-    fi
-
-                GLUEGEN2_RT=$PACKAGE_JAR_FILE
-
-
-                if test "$MACOSX" = 1; then
-                   echo "Check of the presence of libgluegen-rt.jnilib disabled under Mac OS X"
-                else
-                   LDFLAGS_save=$LDFLAGS
-                   # Provide known paths where distribs/OS can store JNI libs
-                   LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
-                   LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
-                   LDFLAGS="$LDFLAGS -L/usr/lib/gluegen2 -L/usr/lib64/gluegen2"         # RedHat
-                   LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
-                   symbol="Java_jogamp_common_jvm_JVMUtil_initialize"
-                   as_ac_Lib=`$as_echo "ac_cv_lib_gluegen2-rt_$symbol" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $symbol in -lgluegen2-rt" >&5
-$as_echo_n "checking for $symbol in -lgluegen2-rt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgluegen2-rt -ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $symbol ();
-int
-main ()
-{
-return $symbol ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-eval ac_res=\$$as_ac_Lib
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  GLUEGEN2_RT_LIBS="-lgluegen2-rt"
-else
-  as_fn_error $? "libgluegen2-rt: Library missing (Cannot find symbol $symbol). Check if libgluegen-rt - C/Java (JNI) interface for GLUEGEN2 - is installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries." "$LINENO" 5
-fi
-
-                   LDFLAGS=$LDFLAGS_save
-                fi
-
-                # Jhall
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jhall" >&5
-$as_echo_n "checking jhall... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jhall.jar" "$jardir/libjhall.jar" "$jardir/libjhall-java.jar" "$jardir/jhall*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 15322 "configure"
-import java.util.regex.Pattern;
-
-import javax.help.JHelp;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test ""yes"" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" "$LINENO" 5
-      fi
-    fi
-
-                # Named differently under Mandriva or Fedora
-                if test -z "$PACKAGE_JAR_FILE"; then
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking javahelp2" >&5
-$as_echo_n "checking javahelp2... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/javahelp2.jar" "$jardir/libjavahelp2.jar" "$jardir/libjavahelp2-java.jar" "$jardir/javahelp2*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 15437 "configure"
-import java.util.regex.Pattern;
-
-import javax.help.JHelp;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
-
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
-}
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" "$LINENO" 5
-      fi
-    fi
-
-                fi
-                JHALL=$PACKAGE_JAR_FILE
-
-
-                # Console API
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-API" >&5
-$as_echo_n "checking jrosetta-API... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jrosetta-API.jar" "$jardir/libjrosetta-API.jar" "$jardir/libjrosetta-API-java.jar" "$jardir/jrosetta-API*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 15555 "configure"
-import java.util.regex.Pattern;
-
-import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
-
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
+                if test "$MACOSX" = 1; then
+                   echo "Check of the presence of libjogl.jnilib and libjogl_awt.jnilib disabled under Mac OS X"
+                else
+                   LDFLAGS_save=$LDFLAGS
+                   # Provide known paths where distribs/OS can store JNI libs
+                   LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
+                   LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
+                   LDFLAGS="$LDFLAGS -L/usr/lib/jogl2 -L/usr/lib64/jogl2"               # RedHat
+                   LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
+                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glTexParameterf in -ljogl_desktop" >&5
+$as_echo_n "checking for glTexParameterf in -ljogl_desktop... " >&6; }
+if ${ac_cv_lib_jogl_desktop_glTexParameterf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljogl_desktop  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char glTexParameterf ();
+int
+main ()
+{
+return glTexParameterf ();
+  ;
+  return 0;
 }
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
-
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test ""yes"" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" "$LINENO" 5
-      fi
-    fi
-
-                if test -z "$PACKAGE_JAR_FILE"; then
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-api" >&5
-$as_echo_n "checking jrosetta-api... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jrosetta-api.jar" "$jardir/libjrosetta-api.jar" "$jardir/libjrosetta-api-java.jar" "$jardir/jrosetta-api*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
-
-    cat << \EOF > conftest.java
-// #line 15669 "configure"
-import java.util.regex.Pattern;
-
-import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
-
-public class conftest {
-    public static void main(String[] argv) {
-
-    }
-
-    private static int compare(String v1, String v2) {
-        String s1 = normalisedVersion(v1);
-        String s2 = normalisedVersion(v2);
-        return s1.compareTo(s2);
-    }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_jogl_desktop_glTexParameterf=yes
+else
+  ac_cv_lib_jogl_desktop_glTexParameterf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jogl_desktop_glTexParameterf" >&5
+$as_echo "$ac_cv_lib_jogl_desktop_glTexParameterf" >&6; }
+if test "x$ac_cv_lib_jogl_desktop_glTexParameterf" = xyes; then :
+  JOGL2_LIBS="-ljogl_desktop"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not link against -ljogl_desktop. Will try against -ljogl_desktop -lGL" >&5
+$as_echo "$as_me: WARNING: Could not link against -ljogl_desktop. Will try against -ljogl_desktop -lGL" >&2;}
+fi
 
-    private static String normalisedVersion(String version) {
-        return normalisedVersion(version, ".", 4);
-    }
+                   if test -z "$JOGL2_LIBS"; then # The previous test failed add more options to the LDFLAGS
+                       # the space after "jogl" in the following line is on
+                       # purpose to disable the cache
+                          as_ac_Lib=`$as_echo "ac_cv_lib_jogl_desktop ''_glTexParameterf" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glTexParameterf in -ljogl_desktop " >&5
+$as_echo_n "checking for glTexParameterf in -ljogl_desktop ... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljogl_desktop  -lGL $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    private static String normalisedVersion(String version, String sep, int maxWidth) {
-        String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
-        StringBuilder sb = new StringBuilder();
-        for (String s : split) {
-            sb.append(String.format("%" + maxWidth + 's', s));
-        }
-        return sb.toString();
-    }
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char glTexParameterf ();
+int
+main ()
+{
+return glTexParameterf ();
+  ;
+  return 0;
 }
-EOF
-
-    CLASSPATH=$ac_java_classpath
-    export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  JOGL2_LIBS="-ljogl_desktop -lGL"
+else
+  as_fn_error $? "\"libjogl: Library
+missing (Cannot find symbol glTexParameterf). Check if libjogl - C/Java (JNI)
+interface for JOGL2 - or libGL (OpenGL library) are installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries.\"" "$LINENO" 5
+fi
 
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
+                   fi
 
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
+                   LDFLAGS=$LDFLAGS_save
                 fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
 
-            ac_java_classpath=$saved_ac_java_classpath
+                # JoGL Native <=> Java connector
 
 
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
 
-            ac_java_classpath=$saved_ac_java_classpath
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking gluegen2-rt" >&5
+$as_echo_n "checking gluegen2-rt... " >&6; }
+    PACKAGE_JAR_FILE=
 
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-            fi
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'gluegen2-rt.jar' -or -name 'libgluegen2-rt.jar' -or -name 'libgluegen2-rt-java.jar' -or -name 'gluegen2-rt*.jar' \) -printf '%p:' 2>/dev/null)."
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" "$LINENO" 5
-      fi
-    fi
+    if test ! -f conftestSharedChecker.class ; then
 
-                fi
-                JROSETTA_API=$PACKAGE_JAR_FILE
+    cat << \EOF > conftestSharedChecker.java
+// #line 15576 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
 
-                # Console Core
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-engine" >&5
-$as_echo_n "checking jrosetta-engine... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jrosetta-engine.jar" "$jardir/libjrosetta-engine.jar" "$jardir/libjrosetta-engine-java.jar" "$jardir/jrosetta-engine*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-    cat << \EOF > conftest.java
-// #line 15787 "configure"
-import java.util.regex.Pattern;
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-import com.artenum.rosetta.core.action.AbstractConsoleAction;
+        System.out.println(path);
+    }
 
-public class conftest {
-    public static void main(String[] argv) {
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker gluegen2-rt jogamp.common.os.MachineDescriptionRuntime $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.core.action.AbstractConsoleAction)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.core.action.AbstractConsoleAction)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.core.action.AbstractConsoleAction)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar gluegen2-rt used by Scilab 3D rendering (looking for package jogamp.common.os.MachineDescriptionRuntime)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                GLUEGEN2_RT=$PACKAGE_JAR_FILE
 
-                JROSETTA_ENGINE=$PACKAGE_JAR_FILE
 
+                if test "$MACOSX" = 1; then
+                   echo "Check of the presence of libgluegen-rt.jnilib disabled under Mac OS X"
+                else
+                   LDFLAGS_save=$LDFLAGS
+                   # Provide known paths where distribs/OS can store JNI libs
+                   LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
+                   LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
+                   LDFLAGS="$LDFLAGS -L/usr/lib/gluegen2 -L/usr/lib64/gluegen2"         # RedHat
+                   LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
+                   symbol="Java_jogamp_common_jvm_JVMUtil_initialize"
+                   as_ac_Lib=`$as_echo "ac_cv_lib_gluegen2-rt_$symbol" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $symbol in -lgluegen2-rt" >&5
+$as_echo_n "checking for $symbol in -lgluegen2-rt... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgluegen2-rt -ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $symbol ();
+int
+main ()
+{
+return $symbol ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  GLUEGEN2_RT_LIBS="-lgluegen2-rt"
+else
+  as_fn_error $? "libgluegen2-rt: Library missing (Cannot find symbol $symbol). Check if libgluegen-rt - C/Java (JNI) interface for GLUEGEN2 - is installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries." "$LINENO" 5
+fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.0.4) of jrosetta-engine" >&5
-$as_echo_n "checking minimal version (1.0.4) of jrosetta-engine... " >&6; }
-   saved_ac_java_classpath=$ac_java_classpath
-   export ac_java_classpath="$JROSETTA_ENGINE:$ac_java_classpath"
-   if test "x" == "x"; then
+                   LDFLAGS=$LDFLAGS_save
+                fi
 
-    cat << \EOF > conftest.java
-// #line 15893 "configure"
-import java.util.regex.Pattern;
+                # Jhall
 
-import com.artenum.rosetta.util.ConfigurationBuilder;
 
-public class conftest {
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jhall" >&5
+$as_echo_n "checking jhall... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jhall.jar' -or -name 'libjhall.jar' -or -name 'libjhall-java.jar' -or -name 'jhall*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 15852 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.0.4";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
-                            System.out.println(ConfigurationBuilder.getVersion());
-                                  if (compare(minVersion, ConfigurationBuilder.getVersion()) > 0) {
-                                   System.exit(-1);
-                                }
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jrosetta-engine. Expected at least 1.0.4. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jrosetta-engine. Expected at least 1.0.4. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
+
+    fi
+
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jhall javax.help.JHelp $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test ""yes"" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar jhall used by Scilab Help Browser (looking for package javax.help.JHelp)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-   else
+                # Named differently under Mandriva or Fedora
+                if test -z "$PACKAGE_JAR_FILE"; then
 
-    cat << \EOF > conftest.java
-// #line 15965 "configure"
-import java.util.regex.Pattern;
 
-import com.artenum.rosetta.util.ConfigurationBuilder;
 
-public class conftest {
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking javahelp2" >&5
+$as_echo_n "checking javahelp2... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'javahelp2.jar' -or -name 'libjavahelp2.jar' -or -name 'libjavahelp2-java.jar' -or -name 'javahelp2*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 16069 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.0.4";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-                            System.out.println(ConfigurationBuilder.getVersion());
-                                  if (compare(minVersion, ConfigurationBuilder.getVersion()) != 0) {
-                                   System.exit(-1);
-                                }
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of jrosetta-engine. Expected exact version 1.0.4. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of jrosetta-engine. Expected exact version 1.0.4. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
+
+    fi
 
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker javahelp2 javax.help.JHelp $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar javahelp2 used by Scilab Help Browser (looking for package javax.help.JHelp)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
     fi
-   ac_java_classpath=$saved_ac_java_classpath
 
+                fi
+                JHALL=$PACKAGE_JAR_FILE
 
 
-                # MathML rendering solution
-                # Used in both graphic & help
+                # Console API
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jeuclid-core" >&5
-$as_echo_n "checking jeuclid-core... " >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-API" >&5
+$as_echo_n "checking jrosetta-API... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/jeuclid-core.jar" "$jardir/libjeuclid-core.jar" "$jardir/libjeuclid-core-java.jar" "$jardir/jeuclid-core*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16058 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import net.sourceforge.jeuclid.LayoutContext;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jrosetta-API.jar' -or -name 'libjrosetta-API.jar' -or -name 'libjrosetta-API-java.jar' -or -name 'jrosetta-API*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 16289 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jrosetta-API com.artenum.rosetta.interfaces.core.ConsoleConfiguration $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" >&2;}
+      if test ""yes"" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar jrosetta-API used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                JEUCLID_CORE=$PACKAGE_JAR_FILE
-
+                if test -z "$PACKAGE_JAR_FILE"; then
 
 
-                ################ Mandatory for graphic_export features #####
-                # XML to PDF/other Translator
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking fop" >&5
-$as_echo_n "checking fop... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-api" >&5
+$as_echo_n "checking jrosetta-api... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/fop.jar" "$jardir/libfop.jar" "$jardir/libfop-java.jar" "$jardir/fop*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16177 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.apache.fop.pdf.PDFInfo;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jrosetta-api.jar' -or -name 'libjrosetta-api.jar' -or -name 'libjrosetta-api-java.jar' -or -name 'jrosetta-api*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 16505 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jrosetta-api com.artenum.rosetta.interfaces.core.ConsoleConfiguration $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar jrosetta-api used by JRosetta : Console API Artenum / Scilab (looking for package com.artenum.rosetta.interfaces.core.ConsoleConfiguration)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                fi
+                JROSETTA_API=$PACKAGE_JAR_FILE
+
+
+                # Console Core
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jrosetta-engine" >&5
+$as_echo_n "checking jrosetta-engine... " >&6; }
+    PACKAGE_JAR_FILE=
 
-                FOP=$PACKAGE_JAR_FILE
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jrosetta-engine.jar' -or -name 'libjrosetta-engine.jar' -or -name 'libjrosetta-engine-java.jar' -or -name 'jrosetta-engine*.jar' \) -printf '%p:' 2>/dev/null)."
 
+    if test ! -f conftestSharedChecker.class ; then
 
-# Check whether --with-emf was given.
-if test "${with_emf+set}" = set; then :
-  withval=$with_emf;
-fi
+    cat << \EOF > conftestSharedChecker.java
+// #line 16725 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
-                if test "x$with_emf" != xno; then
-                    # Freehep Graphics2D
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphics2d" >&5
-$as_echo_n "checking freehep-graphics2d... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/freehep-graphics2d.jar" "$jardir/libfreehep-graphics2d.jar" "$jardir/libfreehep-graphics2d-java.jar" "$jardir/freehep-graphics2d*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-    cat << \EOF > conftest.java
-// #line 16301 "configure"
-import java.util.regex.Pattern;
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-import org.freehep.graphics2d.VectorGraphics;
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-public class conftest {
-    public static void main(String[] argv) {
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jrosetta-engine com.artenum.rosetta.util.ConfigurationBuilder $jar_resolved getVersion 1.0.4 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.util.ConfigurationBuilder)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.util.ConfigurationBuilder)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar jrosetta-engine used by JRosetta : Console Core Artenum / Scilab (looking for package com.artenum.rosetta.util.ConfigurationBuilder)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                    FREEHEP_GRAPHICS2D=$PACKAGE_JAR_FILE
+                JROSETTA_ENGINE=$PACKAGE_JAR_FILE
 
 
-                    # Freehep GraphicsIO EMF
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio-emf" >&5
-$as_echo_n "checking freehep-graphicsio-emf... " >&6; }
+                # MathML rendering solution
+                # Used in both graphic & help
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking jeuclid-core" >&5
+$as_echo_n "checking jeuclid-core... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/freehep-graphicsio-emf.jar" "$jardir/libfreehep-graphicsio-emf.jar" "$jardir/libfreehep-graphicsio-emf-java.jar" "$jardir/freehep-graphicsio-emf*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16418 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.freehep.graphicsio.emf.EMFGraphics2D;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jeuclid-core.jar' -or -name 'libjeuclid-core.jar' -or -name 'libjeuclid-core-java.jar' -or -name 'jeuclid-core*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 16946 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker jeuclid-core net.sourceforge.jeuclid.LayoutContext $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar jeuclid-core used by MathML rendering solution (at least version 3.1.X) (looking for package net.sourceforge.jeuclid.LayoutContext)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                    FREEHEP_GRAPHICSIO_EMF=$PACKAGE_JAR_FILE
+                JEUCLID_CORE=$PACKAGE_JAR_FILE
 
 
-                    # Freehep GraphicsIO
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio" >&5
-$as_echo_n "checking freehep-graphicsio... " >&6; }
+                ################ Mandatory for graphic_export features #####
+                # XML to PDF/other Translator
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking fop" >&5
+$as_echo_n "checking fop... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/freehep-graphicsio.jar" "$jardir/libfreehep-graphicsio.jar" "$jardir/libfreehep-graphicsio-java.jar" "$jardir/freehep-graphicsio*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16535 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.freehep.graphicsio.VectorGraphicsIO;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'fop.jar' -or -name 'libfop.jar' -or -name 'libfop-java.jar' -or -name 'fop*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 17167 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
+    else
+        echo "configure: failed program was:" >&5
+        cat conftestSharedChecker.java >&5
+        echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
+    fi
 
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker fop org.apache.fop.pdf.PDFInfo $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar fop used by XML to PDF Translator (fop) (looking for package org.apache.fop.pdf.PDFInfo)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
+                FOP=$PACKAGE_JAR_FILE
 
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
 
-            ac_java_classpath=$saved_ac_java_classpath
+
+# Check whether --with-emf was given.
+if test "${with_emf+set}" = set; then :
+  withval=$with_emf;
+fi
+
+                if test "x$with_emf" != xno; then
+                    # Freehep Graphics2D
 
 
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
-    else
-        echo "configure: failed program was:" >&5
-        cat conftest.java >&5
-        echo "configure: CLASSPATH was $CLASSPATH" >&5
 
-            ac_java_classpath=$saved_ac_java_classpath
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphics2d" >&5
+$as_echo_n "checking freehep-graphics2d... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'freehep-graphics2d.jar' -or -name 'libfreehep-graphics2d.jar' -or -name 'libfreehep-graphics2d-java.jar' -or -name 'freehep-graphics2d*.jar' \) -printf '%p:' 2>/dev/null)."
 
-            fi
+    if test ! -f conftestSharedChecker.class ; then
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" >&2;}
-      else
-          as_fn_error $? "Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" "$LINENO" 5
-      fi
-    fi
+    cat << \EOF > conftestSharedChecker.java
+// #line 17393 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
 
-                    FREEHEP_GRAPHICSIO=$PACKAGE_JAR_FILE
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
 
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-                    # Freehep IO
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-io" >&5
-$as_echo_n "checking freehep-io... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/freehep-io.jar" "$jardir/libfreehep-io.jar" "$jardir/libfreehep-io-java.jar" "$jardir/freehep-io*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-    cat << \EOF > conftest.java
-// #line 16652 "configure"
-import java.util.regex.Pattern;
+        System.out.println(path);
+    }
 
-import org.freehep.util.io.XMLSequence;
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
-public class conftest {
-    public static void main(String[] argv) {
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker freehep-graphics2d org.freehep.graphics2d.VectorGraphics $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar freehep-graphics2d used by Freehep Graphics2D (looking for package org.freehep.graphics2d.VectorGraphics)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                    FREEHEP_IO=$PACKAGE_JAR_FILE
+                    FREEHEP_GRAPHICS2D=$PACKAGE_JAR_FILE
 
 
-                    # Freehep Util
+                    # Freehep GraphicsIO
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-util" >&5
-$as_echo_n "checking freehep-util... " >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio" >&5
+$as_echo_n "checking freehep-graphicsio... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/freehep-util.jar" "$jardir/libfreehep-util.jar" "$jardir/libfreehep-util-java.jar" "$jardir/freehep-util*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16769 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.freehep.util.StringUtilities;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'freehep-graphicsio.jar' -or -name 'libfreehep-graphicsio.jar' -or -name 'libfreehep-graphicsio-java.jar' -or -name 'freehep-graphicsio*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 17612 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker freehep-graphicsio org.freehep.graphicsio.VectorGraphicsIO $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar freehep-graphicsio used by Freehep GraphicsIO (looking for package org.freehep.graphicsio.VectorGraphicsIO)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                    FREEHEP_UTIL=$PACKAGE_JAR_FILE
+                    FREEHEP_GRAPHICSIO=$PACKAGE_JAR_FILE
 
-                fi
 
-                # xml.apache.org SVG Library (under mandriva for example)
+                    # Freehep GraphicsIO EMF
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik-all" >&5
-$as_echo_n "checking batik-all... " >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio-emf" >&5
+$as_echo_n "checking freehep-graphicsio-emf... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/batik-all.jar" "$jardir/libbatik-all.jar" "$jardir/libbatik-all-java.jar" "$jardir/batik-all*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 16887 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.apache.batik.parser.Parser;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'freehep-graphicsio-emf.jar' -or -name 'libfreehep-graphicsio-emf.jar' -or -name 'libfreehep-graphicsio-emf-java.jar' -or -name 'freehep-graphicsio-emf*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 17831 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker freehep-graphicsio-emf org.freehep.graphicsio.emf.EMFGraphics2D $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-      if test ""yes"" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" >&2;}
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar freehep-graphicsio-emf used by Freehep GraphicsIO EMF (looking for package org.freehep.graphicsio.emf.EMFGraphics2D)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                BATIK=$PACKAGE_JAR_FILE
+                    FREEHEP_GRAPHICSIO_EMF=$PACKAGE_JAR_FILE
 
-                if test -z "$BATIK"; then
-                   # Other other distribs
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik" >&5
-$as_echo_n "checking batik... " >&6; }
+                    # Freehep IO
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-io" >&5
+$as_echo_n "checking freehep-io... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/batik.jar" "$jardir/libbatik.jar" "$jardir/libbatik-java.jar" "$jardir/batik*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 17004 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.apache.batik.parser.Parser;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'freehep-io.jar' -or -name 'libfreehep-io.jar' -or -name 'libfreehep-io-java.jar' -or -name 'freehep-io*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 18050 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
 
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker freehep-io org.freehep.util.io.XMLSequence $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.parser.Parser)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar freehep-io used by Freehep IO (looking for package org.freehep.util.io.XMLSequence)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                   BATIK=$PACKAGE_JAR_FILE
-                fi
+                    FREEHEP_IO=$PACKAGE_JAR_FILE
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.7) of batik" >&5
-$as_echo_n "checking minimal version (1.7) of batik... " >&6; }
-   saved_ac_java_classpath=$ac_java_classpath
-   export ac_java_classpath="$BATIK:$ac_java_classpath"
-   if test "x" == "x"; then
+                    # Freehep Util
 
-    cat << \EOF > conftest.java
-// #line 17111 "configure"
-import java.util.regex.Pattern;
 
-import org.apache.batik.Version;
 
-public class conftest {
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-util" >&5
+$as_echo_n "checking freehep-util... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'freehep-util.jar' -or -name 'libfreehep-util.jar' -or -name 'libfreehep-util-java.jar' -or -name 'freehep-util*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 18269 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.7";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
-                            System.out.println(Version.getVersion());
-                                  if (compare(minVersion, Version.getVersion()) > 0) {
-                                   System.exit(-1);
-                                }
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of batik. Expected at least 1.7. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of batik. Expected at least 1.7. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
 
-   else
+    fi
 
-    cat << \EOF > conftest.java
-// #line 17183 "configure"
-import java.util.regex.Pattern;
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker freehep-util org.freehep.util.StringUtilities $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test "" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar freehep-util used by Freehep Util (looking for package org.freehep.util.StringUtilities)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
+
+                    FREEHEP_UTIL=$PACKAGE_JAR_FILE
 
-import org.apache.batik.Version;
+                fi
 
-public class conftest {
+                # xml.apache.org SVG Library (under mandriva for example)
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik-all" >&5
+$as_echo_n "checking batik-all... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'batik-all.jar' -or -name 'libbatik-all.jar' -or -name 'libbatik-all-java.jar' -or -name 'batik-all*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 18489 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
-        String minVersion="1.7";
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
 
-                            System.out.println(Version.getVersion());
-                                  if (compare(minVersion, Version.getVersion()) != 0) {
-                                   System.exit(-1);
-                                }
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""yes"" = "no"; then
-           echo "yes" >&5
-              echo "yes"
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-                  echo "yes"
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-                  as_fn_error $? "Wrong version of batik. Expected exact version 1.7. Found $STDOUT" "$LINENO" 5
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
-          as_fn_error $? "Wrong version of batik. Expected exact version 1.7. Found $STDOUT" "$LINENO" 5
-            fi
+    fi
+
+    fi
 
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker batik-all org.apache.batik.Version $jar_resolved getVersion 1.7 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      if test ""yes"" = "yes"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.Version)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.Version)" >&2;}
+      else
+          as_fn_error $? "Could not find or use the Java package/jar batik-all used by Apache SVG Library (looking for package org.apache.batik.Version)" "$LINENO" 5
+      fi
+    fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
     fi
-   ac_java_classpath=$saved_ac_java_classpath
 
+                BATIK=$PACKAGE_JAR_FILE
+
+                if test -z "$BATIK"; then
+                   # Other other distribs
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik" >&5
+$as_echo_n "checking batik... " >&6; }
+    PACKAGE_JAR_FILE=
+
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
+
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'batik.jar' -or -name 'libbatik.jar' -or -name 'libbatik-java.jar' -or -name 'batik*.jar' \) -printf '%p:' 2>/dev/null)."
+
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 18708 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
+    public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
 
-                # Commons I/O library
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking commons-io" >&5
-$as_echo_n "checking commons-io... " >&6; }
-    PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/commons-io.jar" "$jardir/libcommons-io.jar" "$jardir/libcommons-io-java.jar" "$jardir/commons-io*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
-    cat << \EOF > conftest.java
-// #line 17274 "configure"
-import java.util.regex.Pattern;
+        System.out.println(path);
+    }
 
-import org.apache.commons.io.output.CountingOutputStream;
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
-public class conftest {
-    public static void main(String[] argv) {
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
 
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker batik org.apache.batik.Version $jar_resolved getVersion 1.7 "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.Version)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.Version)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar batik used by Apache SVG Library (looking for package org.apache.batik.Version)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                COMMONS_IO=$PACKAGE_JAR_FILE
+                   BATIK=$PACKAGE_JAR_FILE
+                fi
 
 
-                # XML graphics common
+                # Commons I/O library
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking xmlgraphics-commons" >&5
-$as_echo_n "checking xmlgraphics-commons... " >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking commons-io" >&5
+$as_echo_n "checking commons-io... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/xmlgraphics-commons.jar" "$jardir/libxmlgraphics-commons.jar" "$jardir/libxmlgraphics-commons-java.jar" "$jardir/xmlgraphics-commons*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 17391 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.apache.xmlgraphics.util.Service;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'commons-io.jar' -or -name 'libcommons-io.jar' -or -name 'libcommons-io-java.jar' -or -name 'commons-io*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 18928 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
+
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
 
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value = method.invoke(null);
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                } catch (NullPointerException ex) {
+                    Object value = method.invoke(klass.newInstance());
+                    compareAndDisplay(atLeastOrEqual, expected, value);
+                }
+            }
+        } catch (IllegalAccessException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InvocationTargetException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        } catch (InstantiationException ex) {
+            System.err.println(ex);
+            System.exit(-2);
+        }
+    }
+
+    private static void compareAndDisplay(String atLeastOrEqual, String expected, Object value) {
+        int cmp = compare(expected, value.toString());
+
+        switch(atLeastOrEqual) {
+            case ">":
+                if (cmp > 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "==":
+                if (cmp == 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            case "<=":
+                if (cmp <= 0) {
+                    return;
+                } else {
+                    System.err.println("expected "+atLeastOrEqual+""+expected+" but got "+value);
+                    System.exit(-4);
+                }
+            default:
+                System.err.println("unable to compare with "+atLeastOrEqual);
+                System.exit(-4);
+        }
     }
 
     private static int compare(String v1, String v2) {
         String s1 = normalisedVersion(v1);
         String s2 = normalisedVersion(v2);
+
+        System.err.println("compare: " + v1 + " normalised to " + s1);
+        System.err.println("compare: " + v2 + " normalised to " + s2);
         return s1.compareTo(s2);
     }
 
 
     CLASSPATH=$ac_java_classpath
     export CLASSPATH
-    cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
-    if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
-       if test ""no"" = "no"; then
-           echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-       else
-              cmd="$JAVA conftest"
-              if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
-               echo "yes" >&5
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
-$as_echo "$jar_resolved" >&6; }
-              found_jar=yes
-              PACKAGE_JAR_FILE=$jar_resolved
-              break 3
-
-            else
-                echo "configure: failed program was:" >&5
-                cat conftest.java >&5
-                if test -s conftest.java.output; then
-                   STDOUT=`cat conftest.java.output`
-                fi
-                echo "configure: CLASSPATH was $CLASSPATH" >&5
-
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-                            fi
-        fi
-        if test -f conftest.java.output; then
-           rm conftest.java.output
-        fi
+    cmd="$JAVAC ${JAVAC_FLAGS} conftestSharedChecker.java"
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5) ; then
+        echo "configure: conftestSharedChecker.class available" >&5
     else
         echo "configure: failed program was:" >&5
-        cat conftest.java >&5
+        cat conftestSharedChecker.java >&5
         echo "configure: CLASSPATH was $CLASSPATH" >&5
+    fi
 
-            ac_java_classpath=$saved_ac_java_classpath
-
-
-            fi
+    fi
 
-          fi
-        done
-      done
-    done
-    if test "$found_jar" = "no"; then
+    CLASSPATH=$ac_java_classpath
+    export CLASSPATH
+    cmd="$JAVA conftestSharedChecker commons-io org.apache.commons.io.output.CountingOutputStream $jar_resolved   "
+    if (echo $cmd >&5 ; eval $cmd >conftestSharedChecker.java.output 2>&5); then
+        PACKAGE_JAR_FILE=$(tail -n 1 conftestSharedChecker.java.output);
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE_JAR_FILE" >&5
+$as_echo "$PACKAGE_JAR_FILE" >&6; }
+        echo "yes" >&5
+        # append the found file to the classpath to manage jar dependency
+        ac_java_classpath="$ac_java_classpath:$PACKAGE_JAR_FILE"
+    else
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       if test "" = "yes"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar xmlgraphics-commons used by Commons graphics library (looking for package org.apache.xmlgraphics.util.Service)" >&5
-$as_echo "$as_me: WARNING: Could not find or use the Java package/jar xmlgraphics-commons used by Commons graphics library (looking for package org.apache.xmlgraphics.util.Service)" >&2;}
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" >&5
+$as_echo "$as_me: WARNING: Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" >&2;}
       else
-          as_fn_error $? "Could not find or use the Java package/jar xmlgraphics-commons used by Commons graphics library (looking for package org.apache.xmlgraphics.util.Service)" "$LINENO" 5
+          as_fn_error $? "Could not find or use the Java package/jar commons-io used by Commons I/O library (looking for package org.apache.commons.io.output.CountingOutputStream)" "$LINENO" 5
       fi
     fi
+    if test -f conftestSharedChecker.java.output; then
+        rm conftestSharedChecker.java.output
+    fi
 
-                XMLGRAPHICS_COMMONS=$PACKAGE_JAR_FILE
+                COMMONS_IO=$PACKAGE_JAR_FILE
 
 
-                # Avalon Framework (PDF)
+                # XML graphics common
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking avalon-framework" >&5
-$as_echo_n "checking avalon-framework... " >&6; }
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking xmlgraphics-commons" >&5
+$as_echo_n "checking xmlgraphics-commons... " >&6; }
     PACKAGE_JAR_FILE=
-    found_jar=no
-    saved_ac_java_classpath=$ac_java_classpath
-    DEFAULT_JAR_DIR="/usr/share/java /usr/lib/java /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null)  $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null)"
-    for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR; do
-      for jar in "$jardir/avalon-framework.jar" "$jardir/libavalon-framework.jar" "$jardir/libavalon-framework-java.jar" "$jardir/avalon-framework*.jar"; do
-
-# TODO check the behaviour when spaces
-        jars_resolved=`ls $jar 2>/dev/null`
-        for jar_resolved in $jars_resolved; do # If several jars matches
-          if test -e "$jar_resolved"; then
-            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
-    cat << \EOF > conftest.java
-// #line 17508 "configure"
-import java.util.regex.Pattern;
+    DEFAULT_JAR_DIR="$(pwd)/thirdparty/ $(pwd)/jar/ /usr/local/java/ /usr/local/java/jar /usr/local/share/java/ /usr/local/share/java/jar/ /usr/local/lib/java/ $(find /usr/share/java/ -maxdepth 1 -type d 2>/dev/null | sort) $(find /usr/lib64/ -maxdepth 1 -type d 2>/dev/null) $(find  /usr/lib/ -maxdepth 1 -type d 2>/dev/null) $(find /usr/share/*/lib -maxdepth 1 -type d 2>/dev/null) /opt/java/lib/"
 
-import org.apache.avalon.framework.configuration.ConfigurationException;
+    jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'xmlgraphics-commons.jar' -or -name 'libxmlgraphics-commons.jar' -or -name 'libxmlgraphics-commons-java.jar' -or -name 'xmlgraphics-commons*.jar' \) -printf '%p:' 2>/dev/null)."
 
-public class conftest {
+    if test ! -f conftestSharedChecker.class ; then
+
+    cat << \EOF > conftestSharedChecker.java
+// #line 19147 "configure"
+import java.util.regex.Pattern;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+
+public class conftestSharedChecker {
+
+    /**
+     * Required arguments :
+     *  argv[0]: name of the jar package
+     *  argv[1]: name of the class (with the package prefix)
+     *  argv[2]: possible paths of the jar package (separated by ':')
+     *
+     * Optional arguments:
+     *  argv[3]: field or method used to retrieve the version
+     *  argv[4]: expected version
+     *  argv[5]: String comparator :
+     *      "="  for exact version
+     */
     public static void main(String[] argv) {
+        final String packageName = argv[0];
+        final String className = argv[1];
+        final String[] jarList = argv[2].split(":");
+
+        ArrayList<URL> found = new ArrayList<>();
+        for(String jar : jarList)
+        {
+            try {
+                File f = new File(jar);
+                if (f.exists()) {
+                    found.add(f.toURI().toURL());
+                }
+            } catch (IOException ex) {
+                System.err.println(ex.toString());
+            }
+        }
+
+        URLClassLoader localClassLoader = new URLClassLoader(found.toArray(new URL[found.size()]));
+        URL klassURL = null;
+        Class<?> klass = null;
+        try {
+            String resourceName = className.replace(".", "/") + ".class";
+            klassURL = localClassLoader.getResource(resourceName);
+            klass = localClassLoader.loadClass(className);
+        } catch (ClassNotFoundException ex) {
+            System.err.println(className + " not found");
+            System.exit(-1);
+        }
+
+        String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+        String path = pathURL.substring(pathURL.indexOf(':') + 1);
+        System.err.println("found: " + path);
+
+        if (argv.length > 3) {
+            checkVersion(klass, argv);
+        }
 
+        System.out.println(path);
+    }
+
+    private static void checkVersion(Class<?> klass, String[] argv) throws SecurityException, IllegalArgumentException {
+        final String versionMethod = argv[3];
+        final String expected = argv[4];
+        final String atLeastOrEqual;
+        if (argv.length > 5)
+            atLeastOrEqual = argv[5];
+        else
+            atLeastOrEqual = "<=";
+
+        try {
+            try {
+                Field field = klass.getField(versionMethod);
+                Object value = field.get(null);
+                compareAndDisplay(atLeastOrEqual, expected, value);
+            } catch (NoSuchFieldException fe) {
+                Method method = null;
+                try {
+                    method = klass.getMethod(versionMethod);
+                } catch (NoSuchMethodException ex) {
+                    System.err.println(ex.toString());
+                    System.exit(-3);
+                }
+
+                try {
+                    Object value&