<p>I have enabled the hazelcast-kubernetes for my application in Java 11, but when I tried to deployed it I got below warning</p>
<pre><code>09-Jun-2021 13:12:05.881 WARNING [main] com.hazelcast.instance.impl.HazelcastInstanceFactory.null Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
</code></pre>
<p>To resolve this I have added java args command in my deployment.yaml as mentioned in this <a href="https://github.com/hazelcast/hazelcast/issues/13151" rel="nofollow noreferrer">link</a></p>
<pre><code>      containers:
  - name: application
    image: docker-image
    command: [&quot;java&quot;]
    args: [&quot; --add-modules java.se \\&quot;, &quot; --add-exports java.base/jdk.internal.ref=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/java.lang=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/java.nio=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/sun.nio.ch=ALL-UNNAMED \\&quot;, &quot; --add-opens java.management/sun.management=ALL-UNNAMED \\&quot;, &quot; --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \\&quot;]
</code></pre>
<p>When I tried to deployed the pod in my cluster I got below error:-</p>
<pre><code>Error: Could not find or load main class  --add-modules java.se \
Caused by: java.lang.ClassNotFoundException:  --add-modules java.se \
</code></pre>

ric
<p>Looks like there's an issue with your arguments.</p>
<p>Change:</p>
<pre><code>args: [&quot; --add-modules java.se \\&quot;, &quot; --add-exports java.base/jdk.internal.ref=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/java.lang=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/java.nio=ALL-UNNAMED \\&quot;, &quot; --add-opens java.base/sun.nio.ch=ALL-UNNAMED \\&quot;, &quot; --add-opens java.management/sun.management=ALL-UNNAMED \\&quot;, &quot; --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \\&quot;]
</code></pre>
<p>To:</p>
<pre><code>args:
- --add-modules
- java.se
- --add-exports
- java.base/jdk.internal.ref=ALL-UNNAMED
- --add-opens
- java.base/java.lang=ALL-UNNAMED
- --add-opens
- java.base/java.nio=ALL-UNNAMED
- --add-opens
- java.base/sun.nio.ch=ALL-UNNAMED
- --add-opens
- java.management/sun.management=ALL-UNNAMED
- --add-opens
- jdk.management/com.sun.management.internal=ALL-UNNAMED
</code></pre>
