Jetty, Tomcat, servlet
Why can't jps find my long-running Java process?
jps finds itself so its good to use the -l option you can tell process apart.
1. Your process and jps both need to use the same tmp folder
jps -l -J-Djava.io.tmpdir=/the-tmp-dir
where /the-tmp-dir is the same as your process.
2. Since its long running maybe the files were cleaned up form the tmp folder.
Make a file called /etc/tmpfiles.d/jps.conf that contains:
This will exclude the tracking files from cleanup.
You can restart you long running process to recreate these files.