Monitoring ES JVM with jolokia javaagent


I want to monitor ES JVM using jolokia java agent.

I have configured below options in /etc/elasticsearch/jvm.options.d/jmx.options


after restart ES , i get below error & ES won't start.
can anyone suggest a fix for this?

same setup works in my dev environment , which has ES 8.2.2
this doesn't work in prod , which has ES 8.3.2

i also tried setting same option in /etc/sysconfig/elasticsearch , but again it works in Dev , but not on prod.

Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(
at java.base/java.lang.reflect.Method.invoke(
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(
Caused by: java.lang.NoClassDefFoundError: com/sun/net/httpserver/Authenticator
at org.jolokia.jvmagent.JvmAgent.premain(
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(
... 3 more
Caused by: java.lang.ClassNotFoundException:
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed