jdk10 message NOTE: Picked up JDK_JAVA_OPTIONS:

Viewed 23470

Odd issue I've come across with Tomcat 8.5 using JDK10. It starts up fine but when issuing shutdown I am confronted with this Note:

NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

The java process remains running thus prompting me to kill the PID in order to stop it.

Anyone have info on this what I need to do to resolve?

Thanks!

2 Answers

Feature, not a bug

According to this mailing list thread, the messages refer to options set by Tomcat when running on Java 9 and later to maintain important features (memory leak prevention/detection) in the face of the changes within Java. I presume the changes are related to the Java Platform Module System.

So this is a feature, not a bug.

The java process remains running

I do not see this behavior when running Java 13.0.1 from AdoptOpenJDK on macOS Mojave. After executing shutdown.sh with Tomcat 9.0.27, I find no java processes listed in Activity Monitor.app.

I suspect your java process continuing is due to some other cause. For example, speaking from experience, the thread pool of an executor service not being shut down.

When quitting Tomcat 9, I do get a message similar to what you posted:

NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

I had the same problem. I went to the tomcat logs with the command line:

$ sudo tail -f / opt / tomcat / log / catalina.out

while restarting the service look at the latest messages.

One solution is to comment on the line:

Environment = 'CATALINA_OPTS = -Xms512M -Xmx1024M -server -XX: + UseParallelGC'

from thetomcat.service daemon and restart the service. This line controls the memory allocated and blocks the rise of the service. That's works for me, and I'll use Tomcat only for local testing and learn, not as real servlet server it doesn't matter for me, but I think it's not ideal solution for a real production Tomcat.

It may also be helpful to check the Apache2 error logs the with the same command that I use with catalina.out.

I hope it will be useful for somebody else.

Related