jrunscript in a target VM
Mustang's jrunscript is cool, but it just launches a new VM and runs your script. Sometimes you want to find out what is going on in an existing process, or control it somehow, using JavaScript. Now you can!
Download
jrunscriptin.jar
and run with
java -jar jrunscriptin.jar(on Mustang) for usage information, quoted here for your convenience:
Usage: java -jar jrunscriptin.jar <PID>Sourceswhere <PID> is as in jps java -jar jrunscriptin.jar <match> <JavaScript> where <match> is some substring of the text after a PID visible in jps -lm Example using NetBeans IDE (quoting as in Bourne Shell, adapt as needed): java -jar jrunscriptin.jar netbeans \ 'Packages.org.openide.awt.StatusDisplayer.getDefault().setStatusText("Hello from abroad!"); \ java.lang.System.out.println("OK!")' Requires Mustang (JDK 6) for both this tool and the target VM.
Posted at 02:11PM Feb 15, 2006 by jglick in Sun | Comments[4]
Posted by Alex Lam on February 18, 2006 at 07:18 AM EST #
Revised sources (binary JAR in same place)
Posted by Jesse Glick on February 18, 2006 at 08:45 PM EST #
Posted by Alex Lam on February 18, 2006 at 08:59 PM EST #
Now hosted on Kenai! http://kenai.com/projects/jrunscriptin
Posted by Jesse Glick on June 10, 2009 at 10:30 AM EDT #