Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 2.4
    • None
    • None
    • None

    Description

      Please make required changes so that Ignite runs on Java 10.

      The blocking issue I encontered is related to the usage of Unsafe:

      Caused by: java.lang.RuntimeException: jdk.internal.misc.JavaNioAccess class is unavailable.
      at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1459)
      at org.apache.ignite.internal.util.GridUnsafe.<clinit>(GridUnsafe.java:118)
      ... 30 more
      Caused by: java.lang.IllegalAccessException: class org.apache.ignite.internal.util.GridUnsafe cannot access class jdk.internal.misc.SharedSecrets (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @754ba872
      at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:360)
      at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:589)
      at java.base/java.lang.reflect.Method.invoke(Method.java:556)
      at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1456)
      ... 31 more

       

       

      Attachments

        Issue Links

        Activity

          I am using Ignite 2.5.0 and would like to run it on Java 10. What should be the JVM_OPTS for Java 10 compatibility ? I am using the same options as Java 9 as below..

          ${JAVA_HOME}/bin/java -version 2>&1 | grep -qE 'java version "(9|10).*"' && {
          JVM_OPTS="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
                    --add-exports java.base/sun.nio.ch=ALL-UNNAMED \
                    --add-exports java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
                    --add-exports jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
                    --add-modules java.xml.bind \
                ${JVM_OPTS}"
          } || true

          Ignite working fine but showing following  warning on startup, is it safe to ignore ?

          WARNING: An illegal reflective access operation has occurred
          WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/opt/apache-ignite-fabric-2.5.0/libs/ignite-core-2.5.0.jar) to field java.nio.Buffer.address
          WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2
          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
          
          melan.nimesh Melan Jayasinghage added a comment - I am using Ignite 2.5.0 and would like to run it on Java 10. What should be the JVM_OPTS for Java 10 compatibility ? I am using the same options as Java 9 as below.. ${JAVA_HOME}/bin/java -version 2>&1 | grep -qE 'java version "(9|10).*" ' && { JVM_OPTS="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \           --add-exports java.base/sun.nio.ch=ALL-UNNAMED \           --add-exports java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \           --add-exports jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \           --add-modules java.xml.bind \       ${JVM_OPTS}" } || true Ignite working fine but showing following  warning on startup, is it safe to ignore ? WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/opt/apache-ignite-fabric-2.5.0/libs/ignite-core-2.5.0.jar) to field java.nio.Buffer.address WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2 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

          I created an question in stackoverflow about the support of Java 10 by Ignite not sure if this was already addressed: https://stackoverflow.com/questions/50938116/apache-ignite-2-5-0-java-10-compatibility-on-mac
           
          I have setup my JAVA_HOME environment variable by $HOME/.profile this way:

          export JAVA_HOME="$(/usr/libexec/java_home)"

          Downloaded the release apache-ignite-fabric-2.5.0-bin.zip

          Checking environment:

          josepens-mbp:bin josepen$ echo $JAVA_HOME
          /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home

          josepens-mbp:bin josepen$ $JAVA_HOME/bin/java --version
          java 10.0.1 2018-04-17
          Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
          Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

          Everything seems fine, however when running bin/.ignite.sh get the following error:

          josepens-mbp:bin josepen$ ./ignite.sh
          ./ignite.sh, ERROR: The version of JAVA installed in JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home is incorrect. Please point JAVA_HOME variable to installation of JDK 1.8 or JDK 9.
          You can also download latest JDK at http://java.com/download

          Is Ignite compatible with Java 10? Thanks.

          jose2883cr José Andrés Peña Villalobos added a comment - - edited I created an question in stackoverflow about the support of Java 10 by Ignite not sure if this was already addressed: https://stackoverflow.com/questions/50938116/apache-ignite-2-5-0-java-10-compatibility-on-mac   I have setup my  JAVA_HOME  environment variable by  $HOME/.profile  this way: export JAVA_HOME="$(/usr/libexec/java_home)" Downloaded the release  apache-ignite-fabric-2.5.0-bin.zip Checking environment: josepens-mbp:bin josepen$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home josepens-mbp:bin josepen$ $JAVA_HOME/bin/java --version java 10.0.1 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode) Everything seems fine, however when running bin/.ignite.sh get the following error: josepens-mbp:bin josepen$ ./ignite.sh ./ignite.sh, ERROR: The version of JAVA installed in JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home is incorrect. Please point JAVA_HOME variable to installation of JDK 1.8 or JDK 9. You can also download latest JDK at  http://java.com/download Is Ignite compatible with Java 10? Thanks.

          José Andrés Peña Villalobos I believe ignite having compatibility with Java 10, but prechecks on bin/ignite.sh, bin/include/functions.sh prevents us to running it on Java 10 and modifying them should work, I've tested this on Linux environment (yes, it's shows same warning on both Java 9 and 10 )

          bin/ignite.sh - line 154-161

          ${JAVA_HOME}/bin/java -version 2>&1 | grep -qE 'java version "(9|10).*"' && {
          JVM_OPTS="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
                    --add-exports java.base/sun.nio.ch=ALL-UNNAMED \
                    --add-exports java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \
                    --add-exports jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \
                    --add-modules java.xml.bind \
                ${JVM_OPTS}"
          } || true
          

          bin/include/functions.sh - line 61 - 72

              "$JAVA" -version 2>&1 | grep -qE 'version "(1.8.*|9.*|10.*)"' || {
                  echo "$0, ERROR:"
                  echo "The version of JAVA installed in JAVA_HOME=$JAVA_HOME is incorrect."
                  echo "Please point JAVA_HOME variable to installation of JDK 1.8, JDK 9 or JDK 10."
                  echo "You can also download latest JDK at http://java.com/download"
                  exit 1
              }
          

           

          melan.nimesh Melan Jayasinghage added a comment - José Andrés Peña Villalobos I believe ignite having compatibility with Java 10, but prechecks on bin/ignite.sh, bin/include/functions.sh prevents us to running it on Java 10 and modifying them should work, I've tested this on Linux environment (yes, it's shows same warning on both Java 9 and 10 ) bin/ignite.sh - line 154-161 ${JAVA_HOME}/bin/java -version 2>&1 | grep -qE 'java version "(9|10).*" ' && { JVM_OPTS="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \           --add-exports java.base/sun.nio.ch=ALL-UNNAMED \           --add-exports java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED \           --add-exports jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED \           --add-modules java.xml.bind \       ${JVM_OPTS}" } || true bin/include/functions.sh - line 61 - 72     "$JAVA" -version 2>&1 | grep -qE 'version "(1.8.*|9.*|10.*)" ' || {         echo "$0, ERROR:"         echo "The version of JAVA installed in JAVA_HOME=$JAVA_HOME is incorrect."         echo "Please point JAVA_HOME variable to installation of JDK 1.8, JDK 9 or JDK 10."         echo "You can also download latest JDK at http: //java.com/download"         exit 1     }  

          Melan Jayasinghage therefore just commenting above lines will hack into get ignite to run on Java 10 platform?

          I'm going to try....

          UPDATE:

          Yeah it bootstraps fine...

          jose2883cr José Andrés Peña Villalobos added a comment - - edited Melan Jayasinghage therefore just commenting above lines will hack into get ignite to run on Java 10 platform? I'm going to try.... UPDATE: Yeah it bootstraps fine...

          Probably it would be better test against Java 11 LTS, because support of 10 ends on the September.

          dkarachentsev Dmitry Karachentsev added a comment - Probably it would be better test against Java 11 LTS, because support of 10 ends on the September .

          Created related ticket: IGNITE-8859

          dkarachentsev Dmitry Karachentsev added a comment - Created related ticket: IGNITE-8859

          Support for Java 17 was added in 2.13. Java 10 is old and not an LTS version.

          sdarlington Stephen Darlington added a comment - Support for Java 17 was added in 2.13. Java 10 is old and not an LTS version.

          People

            Unassigned Unassigned
            abotos Anghel Botos
            Votes:
            1 Vote for this issue
            Watchers:
            Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                In order to see discussions, first confirm access to your Slack account(s) in the following workspace(s): ASF