How can I view the classpath and jvm args of an executing java program in windows

12,864

Solution 1

From the command line I would use

jinfo < pid >

which will give you this information and more

Solution 2

You can fire up JConsole, connect to the JVM running Weblogic and then navigate to the "VM Summary" tab to inspect the classpath/vm args.

Solution 3

You can write a small application to connect via JMX and query the mbean java.lang.Runtime. It has an attribute "ClassPath".

import java.lang.management.*

ManagementFactory.getRuntimeMXBean().getClassPath()
Share:
12,864
Abe
Author by

Abe

Java and Groovy guy with a passion for working on bleeding edge stuff. Love challenges and building from scratch. I am a general technology enthusiast, who secretly believes that world hunger can be solved by sitting in front of your laptop writing code...:). And here's my blog.

Updated on June 18, 2022

Comments

  • Abe
    Abe almost 2 years

    In *nix I just do ps -ef | grep java to see the jvm args and classpath of an executing java program. How can I see it in windows command prompt? I want to see if certain jars are actually in the classpath of a running weblogic server.

  • Abe
    Abe almost 11 years
    This was specifically to know if it can be can be done via command prompt in windows.
  • sanj2sanj
    sanj2sanj almost 9 years
    jmxterm can be used to query the appropriate mbean for classpath.
  • alegria
    alegria over 2 years
    It is awesome that you can even do this in a debug session using watch parameters.