Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-9445

scala-shell uses plain java command

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.0
    • Fix Version/s: 1.7.3, 1.8.1, 1.9.0
    • Component/s: Command Line Client
    • Environment:

      Description

      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) 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`?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Zentol Chesnay Schepler
                Reporter:
                apjanke Andrew Janke
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m