Get java version of working java process

I can use jps to list the running java processes and use jstack -l process_id to get the stack information of the running Java process. I want to know that this process starts based on the java version. Is there any way to do this? I do not need to use the jstack tool. thank.

jstack -l 23819 2014-11-12 12:36:11 OpenJDK full flow sensor 64-bit VM server (mixed mode 23.25-b01):

"Attach Listener" daemon prio = 10 tid = 0x000000000272f800 nid = 0x614b Waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE

Blocked managed synchronizers: - No

+4
source share
4

jcmd, :

jcmd process_id VM.version

+12

:

lsof -p PID | grep jdk

.

+1

Linux

sudo strings /proc/<java_pid>/smaps |grep jre

7f8ff82ac000-7f8ff82ad000 r-xp 00000000 fd: 00 252363860/usr/java/jdk1.8.0_141/jre/lib/amd64/libjaas_unix.so

, JDK .

+1

, Andrew , , , . :

ps -A | grep "^ <the pid>" | grep -o "jdk.*.jdk"

:

jdk1.8.0_05.jdk
0

All Articles