Hi,
First note that:
$ jexec
can't locate java: No such file or directory
$ ls -l /etc/alternatives/jexec
lrwxrwxrwx 1 root root 44 28 déc. 19:45 /etc/alternatives/jexec ->
/usr/lib/jvm/java-17-openjdk-amd64/lib/jexec
$ /usr/lib/jvm/java-17-openjdk-amd64/lib/jexec
Error: -jar requires jar file specification
Syntaxe : java [options] <mainclass> [args...]
(pour exécuter une classe)
ou java [options] -jar <jarfile> [args...]
(pour exécuter un fichier JAR)
ou java [options] -m <module>[/<mainclass>] [args...]
java [options] --module <module>[/<mainclass>] [args...]
(pour exécuter la classe principale dans un module)
[...]
(sorry for the french output)
Second here is a diff output:
$ diff -C 4 openjdk-11-jexec.c openjdk-17-jexec.c
*** openjdk-11-jexec.c 2023-03-20 17:31:50.797625352 +0100
--- openjdk-17-jexec.c 2023-03-20 17:32:32.765543947 +0100
***************
*** 167,178 ****
}
/* Get the path to the java binary, which is in a known position relative
* to our current position, which is in argv[0]. */
! if (getJavaPath(JDK_BASE_DIR "/lib/jexec", java, RELATIVE_DEPTH) != 0) {
errorExit(errno, MISSING_JAVA_MSG);
}
- argi++;
alen = (argc + 2) * (sizeof (const char *));
if (alen <= 0 || alen > INT_MAX / sizeof(char *)) {
errorExit(errno, BAD_ARG_MSG);
}
--- 167,177 ----
}
/* Get the path to the java binary, which is in a known position relative
* to our current position, which is in argv[0]. */
! if (getJavaPath(argv[argi++], java, RELATIVE_DEPTH) != 0) {
errorExit(errno, MISSING_JAVA_MSG);
}
alen = (argc + 2) * (sizeof (const char *));
if (alen <= 0 || alen > INT_MAX / sizeof(char *)) {
errorExit(errno, BAD_ARG_MSG);
}
The two source files have been retrieved using Debian Code Search.
Regards,
Patrice