From 0dee6d9639a4fbad3727aca15da62690c5b533d5 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 9 Jun 2023 15:17:53 +0200 Subject: [PATCH] javaexec: Remove support for 'gij'. * lib/javaexec.c (execute_java_class): Don't test for gij. --- ChangeLog | 3 +++ lib/javaexec.c | 63 +++----------------------------------------------- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/ChangeLog b/ChangeLog index b67a5dcf1e..5aac7edd1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2023-06-09 Bruno Haible + javaexec: Remove support for 'gij'. + * lib/javaexec.c (execute_java_class): Don't test for gij. + javaexec-script: Remove support for 'gij'. * build-aux/javaexec.sh.in: Don't test HAVE_GIJ. * m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_GIJ. Don't set CONF_JAVA diff --git a/lib/javaexec.c b/lib/javaexec.c index fb72fdc675..6f4af37485 100644 --- a/lib/javaexec.c +++ b/lib/javaexec.c @@ -48,7 +48,6 @@ Program from A B C T $JAVA unknown N Y n/a true - gij GCC 3.0 Y Y n/a gij --version >/dev/null 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 @@ -59,9 +58,8 @@ We try the Java virtual machines in the following order: 1. getenv ("JAVA"), because the user must be able to override our 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. + 2. "java", because it is a standard JVM, + 3. "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. @@ -194,61 +192,6 @@ execute_java_class (const char *class_name, unsetenv ("JAVA_HOME"); } - { - static bool gij_tested; - static bool gij_present; - - if (!gij_tested) - { - /* Test for presence of gij: "gij --version > /dev/null" */ - const char *argv[3]; - int exitstatus; - - argv[0] = "gij"; - argv[1] = "--version"; - argv[2] = NULL; - exitstatus = execute ("gij", "gij", argv, NULL, - false, false, true, true, - true, false, NULL); - gij_present = (exitstatus == 0); - gij_tested = true; - } - - if (gij_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] = "gij"; - 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 ("gij", "gij", argv, private_data); - - /* Reset CLASSPATH. */ - reset_classpath (old_classpath); - - freea (argv); - - goto done2; - } - } - { static bool java_tested; static bool java_present; @@ -363,7 +306,7 @@ execute_java_class (const char *class_name, } if (!quiet) - error (0, 0, _("Java virtual machine not found, try installing gij or set $JAVA")); + error (0, 0, _("Java virtual machine not found, try setting $JAVA")); err = true; done2: -- 2.39.5