You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2020/10/12 06:54:29 UTC

[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2436: Detect Java 11 JRE and not only JDK

eolivelli commented on a change in pull request #2436:
URL: https://github.com/apache/bookkeeper/pull/2436#discussion_r503074200



##########
File path: bin/common.sh
##########
@@ -72,7 +72,7 @@ source ${BK_CONFDIR}/bk_cli_env.sh
 
 detect_jdk8() {
 
-  if [ -f "$JAVA_HOME/bin/jshell" ]; then
+  if [ -f "$JAVA_HOME/lib/modules" ]; then

Review comment:
       I have developed this fix on Linux.
   
   We only have to detect that we are on JDK9+ because of lots of command line options that have been dropped and prevent the JVM to start.
   The main difference in JDK9 is the JPMS (Module System) so I think this is a good "test".
   In JDK8 there is no "lib/modules" file, it contains all of the java "modules".
   In the "JDK" and not JRE version there is also a lot of ".jmods" files, but they are not present in the single JRE version.
   I don't want to execute "java -version" because we will have to parse the result and it will be too hard to maintain.
   
   I have tested with AdoptOpenJDK and with Zulu JDK (both JDK and JRE)
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org