GitHub user bobbai00 added a comment to the discussion: Support Java 17 as 
runtime for Scala/Java based micro services

Another compatibility issue: after switching to Java 17, the following issue 
will come out because of Arrow:
```
java.lang.RuntimeException: Failed to initialize MemoryUtil. Was Java started 
with --add-opens=java.base/java.nio=ALL-UNNAMED? (See 
https://arrow.apache.org/docs/java/install.html) at 
org.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:143) at 
org.apache.arrow.memory.ArrowBuf.setZero(ArrowBuf.java:1175) at 
org.apache.arrow.vector.BaseVariableWidthVector.initOffsetBuffer(BaseVariableWidthVector.java:243)
 at 
org.apache.arrow.vector.BaseVariableWidthVector.allocateBytes(BaseVariableWidthVector.java:469)
 at 
org.apache.arrow.vector.BaseVariableWidthVector.allocateNew(BaseVariableWidthVector.java:420)
 at 
org.apache.arrow.vector.BaseVariableWidthVector.allocateNew(BaseVariableWidthVector.java:380)
 at 
org.apache.arrow.vector.VectorSchemaRoot.allocateNew(VectorSchemaRoot.java:147) 
at 
org.apache.amber.engine.architecture.pythonworker.PythonProxyClient.sendECM(PythonProxyClient.scala:144)
 at 
org.apache.amber.engine.architecture.pythonworker.PythonProxyClient.mainLoop(PythonProxyCli
 ent.scala:116) at 
org.apache.amber.engine.architecture.pythonworker.PythonProxyClient.run(PythonProxyClient.scala:79)
 at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
 at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
 at java.base/java.lang.Thread.run(Thread.java:840)
```
The solution is: set the `JDK_JAVA_OPTIONS` to:
```
--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
```
This solution is explicitly required in Arrow's official document: 
https://arrow.apache.org/docs/java/install.html. @chenlica and @aglinxinyuan 
are you guys fine with this one?

GitHub link: 
https://github.com/apache/texera/discussions/4001#discussioncomment-14769595

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]

Reply via email to