The 'jview' JVM was present on Windows XP more than 15 years ago. Current
Windows versions don't have it any more. Therefore it's pointless to test
whether it's available.


2023-06-09  Bruno Haible  <br...@clisp.org>

        javaexec: Remove support for 'jview'.
        * lib/javaexec.c (execute_java_class): Don't test for jview.

        javaexec-script: Remove support for 'jview'.
        * build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
        * m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
        CONF_JAVA to 'jview'.
        (gt_JAVAEXEC_DISABLED): Don't set HAVE_JVIEW.
        * m4/javacomp.m4: Update comment.

>From 5963f181c8f00cbe5ba2db7bf84b407da09d3667 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Fri, 9 Jun 2023 14:56:49 +0200
Subject: [PATCH 1/2] javaexec-script: Remove support for 'jview'.

* build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
CONF_JAVA to 'jview'.
(gt_JAVAEXEC_DISABLED): Don't set HAVE_JVIEW.
* m4/javacomp.m4: Update comment.
---
 ChangeLog                |  9 +++++++++
 build-aux/javaexec.sh.in | 10 ++--------
 m4/javacomp.m4           |  4 ++--
 m4/javaexec.m4           | 19 ++-----------------
 4 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9345067bb7..7ddf123386 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-06-09  Bruno Haible  <br...@clisp.org>
+
+	javaexec-script: Remove support for 'jview'.
+	* build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
+	* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
+	CONF_JAVA to 'jview'.
+	(gt_JAVAEXEC_DISABLED): Don't set HAVE_JVIEW.
+	* m4/javacomp.m4: Update comment.
+
 2023-06-06  Jim Meyering  <meyer...@meta.com>
 
 	maint.mk: regenerate regex to reflect new functions in xalloc.h
diff --git a/build-aux/javaexec.sh.in b/build-aux/javaexec.sh.in
index 2c9f685d11..370dcad3c0 100644
--- a/build-aux/javaexec.sh.in
+++ b/build-aux/javaexec.sh.in
@@ -56,14 +56,8 @@ else
         test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@"
         exec $CONF_JAVA "$@"
       else
-        if test -n "@HAVE_JVIEW@"; then
-          # In this case, $CONF_JAVA is "jview".
-          test -z "$JAVA_VERBOSE" || echo "$CONF_JAVA $@"
-          exec $CONF_JAVA "$@"
-        else
-          echo 'Java virtual machine not found, try installing gij or set $JAVA, then reconfigure' 1>&2
-          exit 1
-        fi
+        echo 'Java virtual machine not found, try installing gij or set $JAVA, then reconfigure' 1>&2
+        exit 1
       fi
     fi
   fi
diff --git a/m4/javacomp.m4 b/m4/javacomp.m4
index 9d2770403b..6980fd6b35 100644
--- a/m4/javacomp.m4
+++ b/m4/javacomp.m4
@@ -1,4 +1,4 @@
-# javacomp.m4 serial 19
+# javacomp.m4 serial 20
 dnl Copyright (C) 2001-2003, 2006-2007, 2009-2023 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -43,7 +43,7 @@
 # target-version can also be omitted. In this case, the required target-version
 # is determined from the found JVM (see macro gt_JAVAEXEC):
 #      target-version   for JVM
-#           1.1         JDK 1.1, jview
+#           1.1         JDK 1.1
 #           1.2         JDK/JRE 1.2
 #           1.3         JDK/JRE 1.3, gij 3.3, 3.4
 #           1.4         JDK/JRE 1.4, gij 4.0 ... 4.2
diff --git a/m4/javaexec.m4 b/m4/javaexec.m4
index 86cdb2152e..316b9e6fb1 100644
--- a/m4/javaexec.m4
+++ b/m4/javaexec.m4
@@ -1,4 +1,4 @@
-# javaexec.m4 serial 8
+# javaexec.m4 serial 9
 dnl Copyright (C) 2001-2003, 2006, 2009-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,6 @@ AC_DEFUN([gt_JAVAEXEC]
   HAVE_GIJ=
   HAVE_JAVA=
   HAVE_JRE=
-  HAVE_JVIEW=
   HAVE_JAVAEXEC=1
   if test -n "$JAVA"; then
     HAVE_JAVA_ENVVAR=1
@@ -33,7 +32,6 @@ AC_DEFUN([gt_JAVAEXEC]
     AC_CHECK_PROG([HAVE_GIJ_IN_PATH], [gij], [yes])
     AC_CHECK_PROG([HAVE_JAVA_IN_PATH], [java], [yes])
     AC_CHECK_PROG([HAVE_JRE_IN_PATH], [jre], [yes])
-    AC_CHECK_PROG([HAVE_JVIEW_IN_PATH], [jview], [yes])
     popdef([AC_MSG_RESULT])dnl
     popdef([AC_CHECKING])dnl
     popdef([AC_MSG_CHECKING])dnl
@@ -69,17 +67,7 @@ AC_DEFUN([gt_JAVAEXEC]
           HAVE_JRE=1
           CONF_JAVA="jre"
         else
-          if test -n "$HAVE_JVIEW_IN_PATH" \
-             && (jview -? >/dev/null 2>/dev/null || test $? = 1) \
-             m4_if([$1], , , [&& {
-               echo "$as_me:__oline__: gij $1" >&AS_MESSAGE_LOG_FD
-               jview $1 >&AS_MESSAGE_LOG_FD 2>&1
-             }]); then
-            HAVE_JVIEW=1
-            CONF_JAVA="jview"
-          else
-            HAVE_JAVAEXEC=
-          fi
+          HAVE_JAVAEXEC=
         fi
       fi
     fi
@@ -100,7 +88,6 @@ AC_DEFUN([gt_JAVAEXEC]
   AC_SUBST([HAVE_GIJ])
   AC_SUBST([HAVE_JAVA])
   AC_SUBST([HAVE_JRE])
-  AC_SUBST([HAVE_JVIEW])
 ])
 
 # Simulates gt_JAVAEXEC when no Java support is desired.
@@ -111,11 +98,9 @@ AC_DEFUN([gt_JAVAEXEC_DISABLED]
   HAVE_GIJ=
   HAVE_JAVA=
   HAVE_JRE=
-  HAVE_JVIEW=
   AC_SUBST([CONF_JAVA])
   AC_SUBST([HAVE_JAVA_ENVVAR])
   AC_SUBST([HAVE_GIJ])
   AC_SUBST([HAVE_JAVA])
   AC_SUBST([HAVE_JRE])
-  AC_SUBST([HAVE_JVIEW])
 ])
-- 
2.34.1

>From e6295ce48edf2bcf0249d5ed861ce824ec10c656 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Fri, 9 Jun 2023 14:57:07 +0200
Subject: [PATCH 2/2] javaexec: Remove support for 'jview'.

* lib/javaexec.c (execute_java_class): Don't test for jview.
---
 ChangeLog      |  3 +++
 lib/javaexec.c | 62 +-------------------------------------------------
 2 files changed, 4 insertions(+), 61 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7ddf123386..40ab73d0e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2023-06-09  Bruno Haible  <br...@clisp.org>
 
+	javaexec: Remove support for 'jview'.
+	* lib/javaexec.c (execute_java_class): Don't test for jview.
+
 	javaexec-script: Remove support for 'jview'.
 	* build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
 	* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
diff --git a/lib/javaexec.c b/lib/javaexec.c
index 0c2c02854d..fb72fdc675 100644
--- a/lib/javaexec.c
+++ b/lib/javaexec.c
@@ -52,7 +52,6 @@
    java       JDK 1.1.8    Y Y  -classpath P   java -version 2>/dev/null
    jre        JDK 1.1.8    N Y  -classpath P   jre 2>/dev/null; test $? = 1
    java       JDK 1.3.0    Y Y  -classpath P   java -version 2>/dev/null
-   jview      MS IE        Y Y  -cp P          jview -? >nul; %errorlevel% = 1
 
    The CLASSPATH is a colon separated list of pathnames. (On Windows: a
    semicolon separated list of pathnames.)
@@ -62,8 +61,7 @@
         preferences,
      2. "gij", because it is a completely free JVM,
      3. "java", because it is a standard JVM,
-     4. "jre", comes last because it requires a CLASSPATH environment variable,
-     5. "jview", on Windows only, because it is frequently installed.
+     4. "jre", comes last because it requires a CLASSPATH environment variable.
 
    We unset the JAVA_HOME environment variable, because a wrong setting of
    this variable can confuse the JDK's javac.
@@ -364,64 +362,6 @@ execute_java_class (const char *class_name,
       }
   }
 
-#if defined _WIN32 || defined __CYGWIN__
-  /* Native Windows, Cygwin */
-  {
-    static bool jview_tested;
-    static bool jview_present;
-
-    if (!jview_tested)
-      {
-        /* Test for presence of jview: "jview -? >nul ; test $? = 1"  */
-        const char *argv[3];
-        int exitstatus;
-
-        argv[0] = "jview";
-        argv[1] = "-?";
-        argv[2] = NULL;
-        exitstatus = execute ("jview", "jview", argv, NULL,
-                              false, false, true, true,
-                              true, false, NULL);
-        jview_present = (exitstatus == 0 || exitstatus == 1);
-        jview_tested = true;
-      }
-
-    if (jview_present)
-      {
-        char *old_classpath;
-        const char **argv =
-          (const char **) xmalloca ((2 + nargs + 1) * sizeof (const char *));
-        unsigned int i;
-
-        /* Set CLASSPATH.  */
-        old_classpath =
-          set_classpath (classpaths, classpaths_count, use_minimal_classpath,
-                         verbose);
-
-        argv[0] = "jview";
-        argv[1] = class_name;
-        for (i = 0; i <= nargs; i++)
-          argv[2 + i] = args[i];
-
-        if (verbose)
-          {
-            char *command = shell_quote_argv (argv);
-            printf ("%s\n", command);
-            free (command);
-          }
-
-        err = executer ("jview", "jview", argv, private_data);
-
-        /* Reset CLASSPATH.  */
-        reset_classpath (old_classpath);
-
-        freea (argv);
-
-        goto done2;
-      }
-  }
-#endif
-
   if (!quiet)
     error (0, 0, _("Java virtual machine not found, try installing gij or set $JAVA"));
   err = true;
-- 
2.34.1

Reply via email to