ostinru commented on code in PR #72:
URL: https://github.com/apache/cloudberry-pxf/pull/72#discussion_r2888312799


##########
server/pxf-service/src/scripts/pxf:
##########
@@ -380,6 +380,16 @@ function do_start() {
     JAVA_OPTS=($PXF_JVM_OPTS  "${PXF_OPTS[@]}")
     
RUN_ARGS=(--spring.config.location=classpath:/application.properties,file:${PXF_BASE}/conf/pxf-application.properties)
 
+    # Detect Java major version and add --add-opens flags for Java 11+
+    local java_major_version
+    java_major_version=$("$javaexe" -version 2>&1 | head -1 | sed -E 
's/.*version "([0-9]+).*/\1/')

Review Comment:
   1. I have found out that java can print some garbage to stdout... should 
filter it before `head -1`.
   2. Java 9 and 10: 
      `openjdk version "9.0.4"` -> 9
      `openjdk version "10.0.2-adoptopenjdk" 2018-07-17` -> 10
      And more interesting java 9+ supports`--add-opens` (JEP 261). However it 
seems to be optional until Java 16/17 (not sure)(JEP 396/403)
   
   
   PS: java8 - doesn't support `--add-opens` that why I have added this IF 
statement
   ```
   java  --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
   Unrecognized option: 
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
   ```
   
   
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to