zer0Id0l
zer0Id0l

Reputation: 1444

MonitoredHost class is not present in the jdk

Class MonitoredHost is not present in the java version i am using which is

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

The api doc says it available under package sun.jvmstat.monitor but the package doesn't appears in my jdk.

Am i missing anything ? Is there any other equivalent class for this which I can use from my java app?

More specifically which java apis can i use for reading all the running java process? (i.e something similar to jps )

Upvotes: 1

Views: 1656

Answers (1)

zer0Id0l
zer0Id0l

Reputation: 1444

After doing some more research I found a good article here which says that its present in tools.jar

  • But here are few catches in using the sun.jvmstat.monitor package :
    • The tool.jar is a library distributed with Oracle JDK but not JRE!
    • You cannot get tool.jar from Maven repo; configure it with Maven is a bit tricky.
    • The tool.jar probably contains platform dependent (native?) code so it is not easily distributable
    • It runs under assumption that all (local) running JVM apps are "monitorable".

Upvotes: 2

Related Questions