How to pass JVM options when using Amazon EMR Hadoop?

0

This documentation page shows how to set the JAVA_HOME environment variable for EMR. I'm experimenting with running another version of Java, and I want to try passing some more command line options to the JVM. Is there another property for that?

I'd like to add arguments like --add-opens java.base/java.lang=ALL-UNNAMED

[
    {
        "Classification": "hadoop-env", 
        "Configurations": [
            {
                "Classification": "export", 
                "Configurations": [], 
                "Properties": {
                    "JAVA_HOME": "/usr/lib/jvm/java-17-amazon-corretto.aarch64"
                }
            }
        ], 
        "Properties": {}
    }
]

The errors I get in EMR logs, which cause me to want to add JVM command line options, look like this:

Caused by: java.lang.reflect.InaccessibleObjectException: 
  Unable to make protected final java.lang.Class
  java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: 
  module java.base does not "opens java.lang" to unnamed module @6cb02d3d
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
robn
已提問 1 年前檢視次數 115 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南