OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (FLINK-9445) start-scala-shell.sh fails on macOS when Java 9 & 10 are installed


Andrew Janke created FLINK-9445:
-----------------------------------

             Summary: start-scala-shell.sh fails on macOS when Java 9 & 10 are installed
                 Key: FLINK-9445
                 URL: https://issues.apache.org/jira/browse/FLINK-9445
             Project: Flink
          Issue Type: Bug
    Affects Versions: 1.5.0
         Environment: macOS High Sierra 10.13.4

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.4
BuildVersion: 17E202

 

I have multiple JDKs installed:


$ ls /Library/Java/JavaVirtualMachines
jdk-10.0.1.jdk jdk-9.0.4.jdk jdk1.7.0_79.jdk jdk1.8.0_141.jdk

 
            Reporter: Andrew Janke


I'm attempting to install and test apache-flink 1.5.0 on macOS using Homebrew.

The test step runs flink's `start-scala-shell.sh` to exercise the package. When I do this, it issues some warnings about log4j and reflective access, and then hangs.

$ brew test apache-flink
 Testing apache-flink
 ==> /usr/local/Cellar/apache-flink/1.5.0/libexec/bin/start-scala-shell.sh local
 Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/tmp/apache-flink-test-20180526-20068-19gl4zf -Duser.home=/Users/janke/Library/Caches/Homebrew/java_cache
 log4j:WARN No appenders could be found for logger (org.apache.flink.configuration.GlobalConfiguration).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See [http://logging.apache.org/log4j/1.2/faq.html#noconfig] for more info.
 WARNING: An illegal reflective access operation has occurred
 WARNING: Illegal reflective access by org.apache.flink.core.memory.HybridMemorySegment ([file:/usr/local/Cellar/apache-flink/1.5.0/libexec/lib/flink-dist_2.11-1.5.0.jar|file:///usr/local/Cellar/apache-flink/1.5.0/libexec/lib/flink-dist_2.11-1.5.0.jar]) to field java.nio.Buffer.address
 WARNING: Please consider reporting this to the maintainers of org.apache.flink.core.memory.HybridMemorySegment
 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
 WARNING: All illegal access operations will be denied in a future release

 

The log4j warnings just mean that log4j hasn't been initialized; no big deal.

The "Illegal reflective access" warnings look like the warnings you see when running Java 8-only software under Java 9 or Java 10.

This happens even when I set `JAVA_HOME` to point at my JDK 8 installation.

I suspect this is because the `start-scala-shell.sh` script calls plain `java` instead of using the `$JAVA_RUN` variable set in flink's `config.sh`, which it called earlier, and which seems to respect `$JAVA_HOME`. From `start-scala-shell.sh`:

if ${EXTERNAL_LIB_FOUND}
 then
   java -Dscala.color -cp "$FLINK_CLASSPATH" $log_setting org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"
 else
   java -Dscala.color -cp "$FLINK_CLASSPATH" $log_setting org.apache.flink.api.scala.FlinkShell $@
 fi

Should `start-scala-shell.sh` be changed to use `$JAVA_HOME` like the other scripts in `libexec`?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)