Skip to content


Subversion checkout URL

You can clone with
Download ZIP
a JMX library for JRuby
Branch: master

Merge pull request #8 from rtyler/gem-rework

Some general gem clean-up/modernization
latest commit 8140fe451d
@jmesnil authored
Failed to load latest commit information.
examples dynamic mbean example
lib Remove the eval statements in DynamicMBean, instead opting for instan…
test update to run agains jruby 1.7.2 (1.9.3p327)
.gitignore ignore doc & pkg dirs
AUTHORS.txt weblogic support
LICENSE.txt initial commit
README.rdoc remove link to deleted wiki
Rakefile Move the gem specification to a gemspec file to follow more recent Ru…
jmx4r.gemspec Move the gem specification to a gemspec file to follow more recent Ru…


jmx4r is a JMX library for JRuby.

It can be used to write simple Ruby scripts running on JRuby to manage remote Java applications (e.g. JBoss, Tomcat) using JMX.

jmx4r helps to manage Java applications using JMX in a simple and powerful way:

  • no need to depend on the Java interfaces of the MBean in your management code. This means less deployment issues

  • Thanks to Ruby metaprogramming toolset, you can treat your MBeans as simple objects and jmx4r hides all the complexity to map them to the API for you

  • you can manage your own JVM (e.g. if you're running a Rails on JRuby application) or a remote JVM in the same way


jruby -S gem install jmx4r


# To trigger a garbage collection on a Java application:

require 'rubygems'
require 'jmx4r'

JMX::MBean.establish_connection :host => "localhost", :port => 3000

memory = JMX::MBean.find_by_name "java.lang:type=Memory"
# display verbose GC logs
memory.verbose = true
# trigger a Garbage Collection

# For local processes not publishing jmxrmi ports, instead:

# connect to the local JConsole process
JMX::MBean.establish_connection :command => /jconsole/i


Source Code

git clone git://
Something went wrong with that request. Please try again.