>From e6295ce48edf2bcf0249d5ed861ce824ec10c656 Mon Sep 17 00:00:00 2001 From: Bruno Haible 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 + 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