Merge remote-tracking branch 'origin/master' into jit 73/17573/2 jit
Antoine ELIAS [Mon, 14 Dec 2015 14:47:25 +0000 (15:47 +0100)]
Conflicts:
scilab/Makefile.in
scilab/configure
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/types/double.hxx
scilab/modules/ast/includes/types/int.hxx
scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/functions/Makefile.am

Change-Id: Ib3b47ed4f7e38e870012f1e5e0ac4966d415076d

105 files changed:
1  2 
scilab/Makefile.am
scilab/Makefile.in
scilab/aclocal.m4
scilab/configure
scilab/configure.ac
scilab/contrib/Makefile.in
scilab/desktop/Makefile.in
scilab/desktop/images/icons/Makefile.in
scilab/modules/Makefile.in
scilab/modules/action_binding/Makefile.in
scilab/modules/api_scilab/Makefile.in
scilab/modules/arnoldi/Makefile.in
scilab/modules/ast/Makefile.am
scilab/modules/ast/Makefile.in
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/ast.vcxproj.filters
scilab/modules/ast/includes/types/bool.hxx
scilab/modules/ast/includes/types/double.hxx
scilab/modules/ast/includes/types/int.hxx
scilab/modules/ast/includes/types/internal.hxx
scilab/modules/ast/src/c/operations/matrix_power.c
scilab/modules/ast/src/cpp/ast/run_CallExp.hpp
scilab/modules/ast/src/cpp/ast/runvisitor.cpp
scilab/modules/ast/src/cpp/jit/JITForExp.cpp
scilab/modules/ast/src/cpp/types/bool.cpp
scilab/modules/ast/src/cpp/types/double.cpp
scilab/modules/atoms/Makefile.in
scilab/modules/boolean/Makefile.in
scilab/modules/cacsd/Makefile.in
scilab/modules/call_scilab/Makefile.in
scilab/modules/commons/Makefile.in
scilab/modules/compatibility_functions/Makefile.in
scilab/modules/completion/Makefile.in
scilab/modules/console/Makefile.in
scilab/modules/core/Makefile.in
scilab/modules/coverage/Makefile.in
scilab/modules/data_structures/Makefile.in
scilab/modules/demo_tools/Makefile.in
scilab/modules/development_tools/Makefile.in
scilab/modules/development_tools/src/fake/Makefile.in
scilab/modules/differential_equations/Makefile.in
scilab/modules/dynamic_link/Makefile.in
scilab/modules/elementary_functions/Makefile.in
scilab/modules/external_objects/Makefile.in
scilab/modules/external_objects_java/Makefile.in
scilab/modules/fftw/Makefile.in
scilab/modules/fileio/Makefile.in
scilab/modules/functions/Makefile.in
scilab/modules/functions/sci_gateway/cpp/functions_gw.vcxproj
scilab/modules/functions/sci_gateway/cpp/functions_gw.vcxproj.filters
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/functions_manager/Makefile.in
scilab/modules/genetic_algorithms/Makefile.in
scilab/modules/graph/Makefile.in
scilab/modules/graphic_export/Makefile.in
scilab/modules/graphic_objects/Makefile.in
scilab/modules/graphics/Makefile.in
scilab/modules/gui/Makefile.in
scilab/modules/hdf5/Makefile.in
scilab/modules/helptools/Makefile.in
scilab/modules/history_browser/Makefile.in
scilab/modules/history_manager/Makefile.in
scilab/modules/integer/Makefile.in
scilab/modules/interpolation/Makefile.in
scilab/modules/io/Makefile.in
scilab/modules/javasci/Makefile.in
scilab/modules/jvm/Makefile.in
scilab/modules/linear_algebra/Makefile.in
scilab/modules/localization/Makefile.in
scilab/modules/m2sci/Makefile.in
scilab/modules/matio/Makefile.in
scilab/modules/mexlib/Makefile.in
scilab/modules/modules_manager/Makefile.in
scilab/modules/mpi/Makefile.in
scilab/modules/optimization/Makefile.in
scilab/modules/output_stream/Makefile.in
scilab/modules/overloading/Makefile.in
scilab/modules/parallel/Makefile.in
scilab/modules/parameters/Makefile.in
scilab/modules/polynomials/Makefile.in
scilab/modules/prebuildjava/Makefile.in
scilab/modules/preferences/Makefile.in
scilab/modules/randlib/Makefile.in
scilab/modules/renderer/Makefile.in
scilab/modules/scicos/Makefile.in
scilab/modules/scicos_blocks/Makefile.in
scilab/modules/scinotes/Makefile.in
scilab/modules/signal_processing/Makefile.in
scilab/modules/simulated_annealing/Makefile.in
scilab/modules/slint/Makefile.in
scilab/modules/sound/Makefile.in
scilab/modules/sparse/Makefile.in
scilab/modules/special_functions/Makefile.in
scilab/modules/spreadsheet/Makefile.in
scilab/modules/statistics/Makefile.in
scilab/modules/string/Makefile.in
scilab/modules/tclsci/Makefile.in
scilab/modules/threads/Makefile.in
scilab/modules/time/Makefile.in
scilab/modules/types/Makefile.in
scilab/modules/ui_data/Makefile.in
scilab/modules/umfpack/Makefile.in
scilab/modules/windows_tools/Makefile.in
scilab/modules/xcos/Makefile.in
scilab/modules/xml/Makefile.in

@@@ -38,24 -38,23 +38,25 @@@ if IS_MACOS
  bin_SCRIPTS           += bin/checkmacosx.applescript
  endif
  
- scilab_bin_LDFLAGS        = $(AM_LDFLAGS) $(OPENMPI_LIBS)
+ scilab_bin_LDFLAGS      = $(AM_LDFLAGS) $(OPENMPI_LIBS)
  scilab_cli_bin_LDFLAGS  = $(AM_LDFLAGS) $(OPENMPI_LIBS)
  
+ #
+ # using the static system libs might produce linkage issue (eg.
+ # std::nothrow for instance) but it seems to be the only acceptable
+ # solution for now.
+ #
  if USE_STATIC_SYSTEM_LIB
- scilab_bin_LDFLAGS += -static-libstdc++ -static-libgcc
- # -static-libgfortran
- scilab_cli_bin_LDFLAGS += -static-libstdc++ -static-libgcc
- #-static-libgfortran
+ scilab_bin_LDFLAGS += -static-libstdc++ -static-libgcc -static-libgfortran
+ scilab_cli_bin_LDFLAGS += -static-libstdc++ -static-libgcc -static-libgfortran
  else
  # Clang (for example) needs an explicit reference to the lib
- scilab_bin_LDFLAGS += -lstdc++
- # -static-libgfortran
- scilab_cli_bin_LDFLAGS += -lstdc++
- #-static-libgfortran
+ scilab_bin_LDFLAGS += -lstdc++ -lgfortran
+ scilab_cli_bin_LDFLAGS += -lstdc++ -lgfortran
  endif
  
 +scilab_bin_LDFLAGS += $(LLVM_LDFLAGS) $(LLVM_LIBS)
 +scilab_cli_bin_LDFLAGS += $(LLVM_LDFLAGS) $(LLVM_LIBS)
  
  if IS_MACOSX
  scilab_bin_LDFLAGS            += -framework Cocoa
@@@ -832,11 -827,10 +836,10 @@@ AM_LDFLAGS = $(SCI_LDFLAGS
  changelogs = CHANGES CHANGES_5.1.X CHANGES_5.2.X CHANGES_5.3.X CHANGES_5.4.X CHANGES_5.5.X CHANGES_6.0.X
  bin_SCRIPTS = bin/scilab bin/scilab-adv-cli bin/scilab-cli \
        bin/scinotes bin/xcos $(am__append_1)
- #-static-libgfortran
  scilab_bin_LDFLAGS = $(AM_LDFLAGS) $(OPENMPI_LIBS) $(am__append_2) \
 -      $(am__append_4) $(am__append_6)
 +      $(am__append_4) $(LLVM_LDFLAGS) $(LLVM_LIBS) $(am__append_6)
  scilab_cli_bin_LDFLAGS = $(AM_LDFLAGS) $(OPENMPI_LIBS) $(am__append_3) \
 -      $(am__append_5)
 +      $(am__append_5) $(LLVM_LDFLAGS) $(LLVM_LIBS)
  scilab_bin_CPPFLAGS = -I$(top_srcdir)/modules/ast/includes/ast/ \
        -I$(top_srcdir)/modules/ast/includes/exps/ \
        -I$(top_srcdir)/modules/ast/includes/operations/ \
Simple merge
@@@ -980,6 -974,6 +981,7 @@@ infodi
  docdir
  oldincludedir
  includedir
++runstatedir
  localstatedir
  sharedstatedir
  sysconfdir
@@@ -1145,6 -1140,6 +1149,7 @@@ datadir='${datarootdir}
  sysconfdir='${prefix}/etc'
  sharedstatedir='${prefix}/com'
  localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
  includedir='${prefix}/include'
  oldincludedir='/usr/include'
  docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
    | -silent | --silent | --silen | --sile | --sil)
      silent=yes ;;
  
++  -runstatedir | --runstatedir | --runstatedi | --runstated \
++  | --runstate | --runstat | --runsta | --runst | --runs \
++  | --run | --ru | --r)
++    ac_prev=runstatedir ;;
++  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++  | --run=* | --ru=* | --r=*)
++    runstatedir=$ac_optarg ;;
++
    -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
      ac_prev=sbindir ;;
    -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
--              libdir localedir mandir
++              libdir localedir mandir runstatedir
  do
    eval ac_val=\$$ac_var
    # Remove trailing slashes.
@@@ -1687,6 -1682,6 +1701,7 @@@ Fine tuning of the installation directo
    --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
    --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
    --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
++  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
    --libdir=DIR            object code libraries [EPREFIX/lib]
    --includedir=DIR        C header files [PREFIX/include]
    --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@@ -11794,7 -11678,7 +11811,7 @@@ $as_echo "$ac_java_classpath" >&6; 
  $as_echo_n "checking to see if the java compiler works... " >&6; }
  
      cat << \EOF > conftest.java
- // #line 11797 "configure"
 -// #line 11681 "configure"
++// #line 11814 "configure"
  import java.util.regex.Pattern;
  
  
@@@ -11881,7 -11765,7 +11898,7 @@@ $as_echo_n "checking type of jvm... " >
      if test "x$ac_java_jvm_name" = "x" ; then
  
      cat << \EOF > conftest.java
- // #line 11884 "configure"
 -// #line 11768 "configure"
++// #line 11901 "configure"
  import java.util.regex.Pattern;
  
  import gnu.java.io.EncodingManager;
@@@ -11965,7 -11849,7 +11982,7 @@@ $as_echo_n "checking java API version..
      # The class java.nio.charset.Charset is new to 1.4
  
      cat << \EOF > conftest.java
- // #line 11968 "configure"
 -// #line 11852 "configure"
++// #line 11985 "configure"
  import java.util.regex.Pattern;
  
  import java.nio.charset.Charset;
      # The class java.lang.StringBuilder is new to 1.5
  
      cat << \EOF > conftest.java
- // #line 12033 "configure"
 -// #line 11917 "configure"
++// #line 12050 "configure"
  import java.util.regex.Pattern;
  
  import java.lang.StringBuilder;
      # The class java.util.ArrayDeque is new to 1.6
  
      cat << \EOF > conftest.java
- // #line 12098 "configure"
 -// #line 11982 "configure"
++// #line 12115 "configure"
  import java.util.regex.Pattern;
  
  import java.util.ArrayDeque;
      # The class java.nio.file.Path is new to 1.7
  
      cat << \EOF > conftest.java
- // #line 12163 "configure"
 -// #line 12047 "configure"
++// #line 12180 "configure"
  import java.util.regex.Pattern;
  
  import java.nio.file.Path;
      # The class java.util.stream.DoubleStream is new to 1.8
  
      cat << \EOF > conftest.java
- // #line 12228 "configure"
 -// #line 12112 "configure"
++// #line 12245 "configure"
  import java.util.regex.Pattern;
  
  import java.util.stream.DoubleStream;
                  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 13706 "configure"
+     cat << \EOF > conftestSharedChecker.java
 -// #line 13575 "configure"
++// #line 13708 "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) {
  
      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' \) 2>/dev/null |tr '\n' ':')."
  
-     { $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 13813 "configure"
+     cat << \EOF > conftestSharedChecker.java
 -// #line 13764 "configure"
++// #line 13897 "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);
+         }
+         String pathURL = klassURL.getPath().substring(0, klassURL.getPath().indexOf('!'));
+         String path = pathURL.substring(pathURL.indexOf(':') + 1);
+         System.err.println("found: " + path);
  
-                             System.out.println(mxGraph.VERSION);
-                                   if (compare(minVersion, mxGraph.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) {
  
      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
+     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 at least 2.0.0.1. Found $STDOUT" "$LINENO" 5
-             fi
+     fi
  
-    else
+     fi
  
-     cat << \EOF > conftest.java
- // #line 13885 "configure"
- import java.util.regex.Pattern;
+     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
  
- import com.mxgraph.view.mxGraph;
+                 fi
  
- public class conftest {
+                 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=
+     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 'scirenderer.jar' -or -name 'libscirenderer.jar' -or -name 'libscirenderer-java.jar' -or -name 'scirenderer*.jar' \) 2>/dev/null |tr '\n' ':')."
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 13985 "configure"
++// #line 14118 "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="2.0.0.1";
+         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(mxGraph.VERSION);
-                                   if (compare(minVersion, mxGraph.VERSION) != 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) {
  
      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 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
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" >&5
+ $as_echo "$as_me: WARNING: Could not find or use the Java package/jar scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" >&2;}
+       else
+           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
  
-                 if test "$with_external_scirenderer" = yes; then
-                    # scirenderer
  
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking scirenderer" >&5
- $as_echo_n "checking scirenderer... " >&6; }
+                # Docking system
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking flexdock" >&5
+ $as_echo_n "checking flexdock... " >&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 13979 "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 'flexdock.jar' -or -name 'libflexdock.jar' -or -name 'libflexdock-java.jar' -or -name 'flexdock*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 14212 "configure"
++// #line 14345 "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) {
@@@ -14065,38 -14400,172 +14533,172 @@@ $as_echo "$PACKAGE_JAR_FILE" >&6; 
        { $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 scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" >&5
- $as_echo "$as_me: WARNING: Could not find or use the Java package/jar scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" >&2;}
+          { $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 scirenderer used by Scilab Renderer (looking for package org.scilab.forge.scirenderer.PackageInfo)" "$LINENO" 5
+           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
  
-                    SCIRENDERER=$PACKAGE_JAR_FILE
-                    SCIRENDERER_CP=$PACKAGE_JAR_FILE
+                 FLEXDOCK=$PACKAGE_JAR_FILE
  
  
-     { $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
+                 # Swing look&feel implementations
  
-     cat << \EOF > conftest.java
- // #line 14086 "configure"
- import java.util.regex.Pattern;
  
- import org.scilab.forge.scirenderer.PackageInfo;
  
- public class conftest {
+     { $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' \) 2>/dev/null |tr '\n' ':')."
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 14431 "configure"
++// #line 14564 "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(":");
  
-                             System.out.println(PackageInfo.VERSION);
-                                   if (compare(minVersion, PackageInfo.VERSION) > 0) {
-                                    System.exit(-1);
-                                 }
+         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) {
  
      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 14158 "configure"
- import java.util.regex.Pattern;
+     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
  
- import org.scilab.forge.scirenderer.PackageInfo;
+                 LOOKS=$PACKAGE_JAR_FILE
  
- public class conftest {
+                 # 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=
+     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 'jgoodies-looks.jar' -or -name 'libjgoodies-looks.jar' -or -name 'libjgoodies-looks-java.jar' -or -name 'jgoodies-looks*.jar' \) 2>/dev/null |tr '\n' ':')."
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 14650 "configure"
++// #line 14783 "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) {
@@@ -14235,33 -14852,159 +14985,159 @@@ $as_echo "$as_me: WARNING: Could not fi
                  fi
  
  
+                 #  Skin Look and Feel
  
-                # 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 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/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 14257 "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 'skinlf.jar' -or -name 'libskinlf.jar' -or -name 'libskinlf-java.jar' -or -name 'skinlf*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 14870 "configure"
++// #line 15003 "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) {
@@@ -14329,444 -15058,172 +15191,172 @@@ $as_echo "$PACKAGE_JAR_FILE" >&6; 
        { $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 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 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 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
  
-                 FLEXDOCK=$PACKAGE_JAR_FILE
-     { $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 14364 "configure"
- import java.util.regex.Pattern;
- import org.flexdock.util.Utilities;
+                 SKINLF=$PACKAGE_JAR_FILE
  
- public class conftest {
-     public static void main(String[] argv) {
-         String minVersion="1.2.4";
  
-                             System.out.println(Utilities.VERSION);
-                                   if (compare(minVersion, Utilities.VERSION) > 0) {
-                                    System.exit(-1);
-                                 }
+                 # JOGL 2
  
-     }
  
-     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);
-     }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking jogl2" >&5
+ $as_echo_n "checking jogl2... " >&6; }
+     PACKAGE_JAR_FILE=
  
-     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
+     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/"
  
-     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
-     else
-         echo "configure: failed program was:" >&5
-         cat conftest.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
+     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' \) 2>/dev/null |tr '\n' ':')."
  
-    else
+     if test ! -f conftestSharedChecker.class ; then
  
-     cat << \EOF > conftest.java
- // #line 14436 "configure"
+     cat << \EOF > conftestSharedChecker.java
 -// #line 15089 "configure"
++// #line 15222 "configure"
  import java.util.regex.Pattern;
- import org.flexdock.util.Utilities;
- public class conftest {
+ 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";
-                             System.out.println(Utilities.VERSION);
-                                   if (compare(minVersion, Utilities.VERSION) != 0) {
-                                    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);
-     }
+         final String packageName = argv[0];
+         final String className = argv[1];
+         final String[] jarList = argv[2].split(":");
  
-     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));
+         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());
+             }
          }
-         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 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
-     else
-         echo "configure: failed program was:" >&5
-         cat conftest.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
-    ac_java_classpath=$saved_ac_java_classpath
-                 # 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"
-     cat << \EOF > conftest.java
- // #line 14527 "configure"
- import java.util.regex.Pattern;
- import com.jgoodies.looks.common.MenuItemRenderer;
- 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));
+         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);
          }
-         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 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"
-     cat << \EOF > conftest.java
- // #line 14644 "configure"
- import java.util.regex.Pattern;
  
- import com.jgoodies.looks.common.MenuItemRenderer;
- public class conftest {
-     public static void main(String[] argv) {
+         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 ""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 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
-                 #  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 14762 "configure"
- import java.util.regex.Pattern;
- import com.l2fprod.util.AccessUtils;
- public class conftest {
-     public static void main(String[] argv) {
  
+     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) {
@@@ -14982,7 -15297,7 +15430,7 @@@ $as_echo_n "checking minimal version (S
      if test "x" == "x"; then
  
      cat << \EOF > conftest.java
- // #line 14985 "configure"
 -// #line 15300 "configure"
++// #line 15433 "configure"
  import java.util.regex.Pattern;
  
  import java.io.IOException;
      else
  
      cat << \EOF > conftest.java
- // #line 15062 "configure"
 -// #line 15377 "configure"
++// #line 15510 "configure"
  import java.util.regex.Pattern;
  
  import java.io.IOException;
      { $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 15264 "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 jogamp.common.os.MachineDescriptionRuntime;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 15576 "configure"
++// #line 15709 "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) {
      { $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 15438 "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 javax.help.JHelp;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 15852 "configure"
++// #line 15985 "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) {
@@@ -15537,27 -16058,152 +16191,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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 15553 "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 javax.help.JHelp;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 16069 "configure"
++// #line 16202 "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) {
@@@ -15655,27 -16278,152 +16411,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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 15671 "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 com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 16289 "configure"
++// #line 16422 "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) {
@@@ -15769,27 -16494,152 +16627,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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 15785 "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 com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 16505 "configure"
++// #line 16638 "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) {
@@@ -15887,27 -16714,152 +16847,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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"
  
-     cat << \EOF > conftest.java
- // #line 15903 "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 com.artenum.rosetta.core.action.AbstractConsoleAction;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 16725 "configure"
++// #line 16858 "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) {
@@@ -15999,27 -16926,161 +17059,161 @@@ $as_echo "$as_me: WARNING: Could not fi
                  JROSETTA_ENGINE=$PACKAGE_JAR_FILE
  
  
-     { $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
  
-     cat << \EOF > conftest.java
- // #line 16009 "configure"
- import java.util.regex.Pattern;
+                 # MathML rendering solution
+                 # Used in both graphic & help
  
- import com.artenum.rosetta.util.ConfigurationBuilder;
  
- public class conftest {
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking jeuclid-core" >&5
+ $as_echo_n "checking jeuclid-core... " >&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 'jeuclid-core.jar' -or -name 'libjeuclid-core.jar' -or -name 'libjeuclid-core-java.jar' -or -name 'jeuclid-core*.jar' \) 2>/dev/null |tr '\n' ':')."
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 16946 "configure"
++// #line 17079 "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) {
  
      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
  
-    else
+     fi
  
-     cat << \EOF > conftest.java
- // #line 16081 "configure"
- import java.util.regex.Pattern;
+     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 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 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
+                 JEUCLID_CORE=$PACKAGE_JAR_FILE
  
- import com.artenum.rosetta.util.ConfigurationBuilder;
  
- public class conftest {
+                 ################ 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=
+     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 'fop.jar' -or -name 'libfop.jar' -or -name 'libfop-java.jar' -or -name 'fop*.jar' \) 2>/dev/null |tr '\n' ':')."
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 17167 "configure"
++// #line 17300 "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) {
      { $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"
  
-     cat << \EOF > conftest.java
- // #line 16417 "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.graphics2d.VectorGraphics;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 17393 "configure"
++// #line 17526 "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) {
@@@ -16513,32 -17594,159 +17727,159 @@@ $as_echo "$as_me: WARNING: Could not fi
                      FREEHEP_GRAPHICS2D=$PACKAGE_JAR_FILE
  
  
-                     # Freehep GraphicsIO EMF
+                     # Freehep GraphicsIO
  
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio-emf" >&5
- $as_echo_n "checking freehep-graphicsio-emf... " >&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-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 16534 "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 'freehep-graphicsio.jar' -or -name 'libfreehep-graphicsio.jar' -or -name 'libfreehep-graphicsio-java.jar' -or -name 'freehep-graphicsio*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 17612 "configure"
++// #line 17745 "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) {
@@@ -16620,42 -17800,172 +17933,172 @@@ $as_echo "$PACKAGE_JAR_FILE" >&6; 
        { $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 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-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 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_GRAPHICSIO_EMF=$PACKAGE_JAR_FILE
+                     FREEHEP_GRAPHICSIO=$PACKAGE_JAR_FILE
  
  
-                     # Freehep GraphicsIO
+                     # Freehep GraphicsIO EMF
  
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-graphicsio" >&5
- $as_echo_n "checking freehep-graphicsio... " >&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/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 16651 "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 'freehep-graphicsio-emf.jar' -or -name 'libfreehep-graphicsio-emf.jar' -or -name 'libfreehep-graphicsio-emf-java.jar' -or -name 'freehep-graphicsio-emf*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 17831 "configure"
++// #line 17964 "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) {
@@@ -16752,27 -18039,152 +18172,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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"
  
-     cat << \EOF > conftest.java
- // #line 16768 "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.io.XMLSequence;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 18050 "configure"
++// #line 18183 "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) {
@@@ -16869,27 -18258,152 +18391,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking freehep-util" >&5
  $as_echo_n "checking freehep-util... " >&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 16885 "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-util.jar' -or -name 'libfreehep-util.jar' -or -name 'libfreehep-util-java.jar' -or -name 'freehep-util*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 18269 "configure"
++// #line 18402 "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) {
@@@ -16987,144 -18478,152 +18611,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik-all" >&5
  $as_echo_n "checking batik-all... " >&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 17003 "configure"
- import java.util.regex.Pattern;
  
- import org.apache.batik.parser.Parser;
+     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/"
  
- public class conftest {
-     public static void main(String[] argv) {
-     }
+     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' \) 2>/dev/null |tr '\n' ':')."
  
-     private static int compare(String v1, String v2) {
-         String s1 = normalisedVersion(v1);
-         String s2 = normalisedVersion(v2);
-         return s1.compareTo(s2);
-     }
+     if test ! -f conftestSharedChecker.class ; then
  
-     private static String normalisedVersion(String version) {
-         return normalisedVersion(version, ".", 4);
-     }
+     cat << \EOF > conftestSharedChecker.java
 -// #line 18489 "configure"
++// #line 18622 "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(":");
  
-     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));
+         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());
+             }
          }
-         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 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;}
-       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
-       fi
-     fi
-                 BATIK=$PACKAGE_JAR_FILE
+         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);
+         }
  
-                 if test -z "$BATIK"; then
-                    # Other other distribs
+         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 batik" >&5
- $as_echo_n "checking batik... " >&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"
+         if (argv.length > 3) {
+             checkVersion(klass, argv);
+         }
  
-     cat << \EOF > conftest.java
- // #line 17120 "configure"
- import java.util.regex.Pattern;
+         System.out.println(path);
+     }
  
- import org.apache.batik.parser.Parser;
+     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) {
  
      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-all org.apache.batik.Version $jar_resolved getVersion 1.8 "
+     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;}
+       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 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 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
  
-                    BATIK=$PACKAGE_JAR_FILE
-                 fi
-     { $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
-     cat << \EOF > conftest.java
- // #line 17227 "configure"
- import java.util.regex.Pattern;
- import org.apache.batik.Version;
- public class conftest {
-     public static void main(String[] argv) {
-         String minVersion="1.7";
-                             System.out.println(Version.getVersion());
-                                   if (compare(minVersion, Version.getVersion()) > 0) {
-                                    System.exit(-1);
-                                 }
-     }
+                 BATIK=$PACKAGE_JAR_FILE
  
-     private static int compare(String v1, String v2) {
-         String s1 = normalisedVersion(v1);
-         String s2 = normalisedVersion(v2);
-         return s1.compareTo(s2);
-     }
+                 if test -z "$BATIK"; then
+                    # Other other distribs
  
-     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 batik. Expected at least 1.7. 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 batik. Expected at least 1.7. Found $STDOUT" "$LINENO" 5
-             fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking batik" >&5
+ $as_echo_n "checking batik... " >&6; }
+     PACKAGE_JAR_FILE=
  
-    else
+     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/"
  
-     cat << \EOF > conftest.java
- // #line 17299 "configure"
- import java.util.regex.Pattern;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- import org.apache.batik.Version;
+     if test ! -f conftestSharedChecker.class ; then
  
- public class conftest {
+     cat << \EOF > conftestSharedChecker.java
 -// #line 18708 "configure"
++// #line 18841 "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);
  
-                             System.out.println(Version.getVersion());
-                                   if (compare(minVersion, Version.getVersion()) != 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) {
@@@ -17374,27 -18917,152 +19050,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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"
  
-     cat << \EOF > conftest.java
- // #line 17390 "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.commons.io.output.CountingOutputStream;
+     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' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 18928 "configure"
++// #line 19061 "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) {
@@@ -17491,27 -19136,152 +19269,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $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/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 17507 "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 'xmlgraphics-commons.jar' -or -name 'libxmlgraphics-commons.jar' -or -name 'libxmlgraphics-commons-java.jar' -or -name 'xmlgraphics-commons*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 19147 "configure"
++// #line 19280 "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) {
@@@ -17608,27 -19355,152 +19488,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking avalon-framework" >&5
  $as_echo_n "checking avalon-framework... " >&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 17624 "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 'avalon-framework.jar' -or -name 'libavalon-framework.jar' -or -name 'libavalon-framework-java.jar' -or -name 'avalon-framework*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 19366 "configure"
++// #line 19499 "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) {
@@@ -17725,27 -19574,152 +19707,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking xml-apis-ext" >&5
  $as_echo_n "checking xml-apis-ext... " >&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/xml-apis-ext.jar" "$jardir/libxml-apis-ext.jar" "$jardir/libxml-apis-ext-java.jar" "$jardir/xml-apis-ext*.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 17741 "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.w3c.dom.svg.SVGDocument;
+     jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'xml-apis-ext.jar' -or -name 'libxml-apis-ext.jar' -or -name 'libxml-apis-ext-java.jar' -or -name 'xml-apis-ext*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 19585 "configure"
++// #line 19718 "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) {
@@@ -17842,27 -19793,152 +19926,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking xml-commons-apis-ext" >&5
  $as_echo_n "checking xml-commons-apis-ext... " >&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/xml-commons-apis-ext.jar" "$jardir/libxml-commons-apis-ext.jar" "$jardir/libxml-commons-apis-ext-java.jar" "$jardir/xml-commons-apis-ext*.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 17858 "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.w3c.dom.svg.SVGDocument;
+     jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'xml-commons-apis-ext.jar' -or -name 'libxml-commons-apis-ext.jar' -or -name 'libxml-commons-apis-ext-java.jar' -or -name 'xml-commons-apis-ext*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 19804 "configure"
++// #line 19937 "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) {
@@@ -17963,144 -20016,152 +20149,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking commons-logging" >&5
  $as_echo_n "checking commons-logging... " >&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-logging.jar" "$jardir/libcommons-logging.jar" "$jardir/libcommons-logging-java.jar" "$jardir/commons-logging*.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 17979 "configure"
- import java.util.regex.Pattern;
  
- import org.apache.commons.logging.LogFactory;
- public class conftest {
-     public static void main(String[] argv) {
+     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 'commons-logging.jar' -or -name 'libcommons-logging.jar' -or -name 'libcommons-logging-java.jar' -or -name 'commons-logging*.jar' \) 2>/dev/null |tr '\n' ':')."
  
-     private static int compare(String v1, String v2) {
-         String s1 = normalisedVersion(v1);
-         String s2 = normalisedVersion(v2);
-         return s1.compareTo(s2);
-     }
+     if test ! -f conftestSharedChecker.class ; then
  
-     private static String normalisedVersion(String version) {
-         return normalisedVersion(version, ".", 4);
-     }
+     cat << \EOF > conftestSharedChecker.java
 -// #line 20027 "configure"
++// #line 20160 "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(":");
  
-     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));
+         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());
+             }
          }
-         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 commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" >&5
- $as_echo "$as_me: WARNING: Could not find or use the Java package/jar commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" >&2;}
-       else
-           as_fn_error $? "Could not find or use the Java package/jar commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" "$LINENO" 5
-       fi
-     fi
-                 COMMONS_LOGGING=$PACKAGE_JAR_FILE
-                 # JLaTeXMath
+         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 jlatexmath" >&5
- $as_echo_n "checking jlatexmath... " >&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/jlatexmath.jar" "$jardir/libjlatexmath.jar" "$jardir/libjlatexmath-java.jar" "$jardir/jlatexmath*.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 18096 "configure"
- import java.util.regex.Pattern;
+         if (argv.length > 3) {
+             checkVersion(klass, argv);
+         }
  
- import org.scilab.forge.jlatexmath.TeXFormula;
+         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) {
@@@ -18182,110 -20215,172 +20348,172 @@@ $as_echo "$PACKAGE_JAR_FILE" >&6; 
        { $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 jlatexmath used by LaTex Rendering (looking for package org.scilab.forge.jlatexmath.TeXFormula)" >&5
- $as_echo "$as_me: WARNING: Could not find or use the Java package/jar jlatexmath used by LaTex Rendering (looking for package org.scilab.forge.jlatexmath.TeXFormula)" >&2;}
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" >&5
+ $as_echo "$as_me: WARNING: Could not find or use the Java package/jar commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" >&2;}
        else
-           as_fn_error $? "Could not find or use the Java package/jar jlatexmath used by LaTex Rendering (looking for package org.scilab.forge.jlatexmath.TeXFormula)" "$LINENO" 5
+           as_fn_error $? "Could not find or use the Java package/jar commons-logging used by Apache logging (looking for package org.apache.commons.logging.LogFactory)" "$LINENO" 5
        fi
      fi
+     if test -f conftestSharedChecker.java.output; then
+         rm conftestSharedChecker.java.output
+     fi
  
-                 JLATEXMATH=$PACKAGE_JAR_FILE
+                 COMMONS_LOGGING=$PACKAGE_JAR_FILE
  
  
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.0.3) of jlatexmath" >&5
- $as_echo_n "checking minimal version (1.0.3) of jlatexmath... " >&6; }
-    saved_ac_java_classpath=$ac_java_classpath
-    export ac_java_classpath="$JLATEXMATH:$ac_java_classpath"
-    if test "x" == "x"; then
+                 # JLaTeXMath
  
-     cat << \EOF > conftest.java
- // #line 18203 "configure"
- import java.util.regex.Pattern;
  
- import org.scilab.forge.jlatexmath.TeXFormula;
  
- public class conftest {
-     public static void main(String[] argv) {
-         String minVersion="1.0.3";
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking jlatexmath" >&5
+ $as_echo_n "checking jlatexmath... " >&6; }
+     PACKAGE_JAR_FILE=
  
-                             System.out.println(TeXFormula.VERSION);
-                                   if (compare(minVersion, TeXFormula.VERSION) > 0) {
-                                    System.exit(-1);
-                                 }
+     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 'jlatexmath.jar' -or -name 'libjlatexmath.jar' -or -name 'libjlatexmath-java.jar' -or -name 'jlatexmath*.jar' \) 2>/dev/null |tr '\n' ':')."
  
-     private static int compare(String v1, String v2) {
-         String s1 = normalisedVersion(v1);
-         String s2 = normalisedVersion(v2);
-         return s1.compareTo(s2);
-     }
+     if test ! -f conftestSharedChecker.class ; then
  
-     private static String normalisedVersion(String version) {
-         return normalisedVersion(version, ".", 4);
-     }
+     cat << \EOF > conftestSharedChecker.java
 -// #line 20246 "configure"
++// #line 20379 "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(":");
  
-     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));
+         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());
+             }
          }
-         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 jlatexmath. Expected at least 1.0.3. 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 jlatexmath. Expected at least 1.0.3. Found $STDOUT" "$LINENO" 5
-             fi
+         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);
+         }
  
-    else
+         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 18275 "configure"
- import java.util.regex.Pattern;
+         if (argv.length > 3) {
+             checkVersion(klass, argv);
+         }
  
- import org.scilab.forge.jlatexmath.TeXFormula;
+         System.out.println(path);
+     }
  
- public class conftest {
-     public static void main(String[] argv) {
-         String minVersion="1.0.3";
+     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(TeXFormula.VERSION);
-                                   if (compare(minVersion, TeXFormula.VERSION) != 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) {
@@@ -18350,27 -20454,152 +20587,152 @@@ $as_echo "$as_me: WARNING: Could not fi
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking jlatexmath-fop" >&5
  $as_echo_n "checking jlatexmath-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/jlatexmath-fop.jar" "$jardir/libjlatexmath-fop.jar" "$jardir/libjlatexmath-fop-java.jar" "$jardir/jlatexmath-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 18366 "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.jlatexmath.fop.JLaTeXMathObj;
+     jar_resolved="$(find $DEFAULT_JAR_DIR -maxdepth 1 \( -type f -name 'jlatexmath-fop.jar' -or -name 'libjlatexmath-fop.jar' -or -name 'libjlatexmath-fop-java.jar' -or -name 'jlatexmath-fop*.jar' \) 2>/dev/null |tr '\n' ':')."
  
- public class conftest {
+     if test ! -f conftestSharedChecker.class ; then
+     cat << \EOF > conftestSharedChecker.java
 -// #line 20465 "configure"
++// #line 20598 "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);
+