Using Java analysis tools jsadebug, jinfo, and jmap

Some of the Java analysis tools access other Java processes via the HotSpot serviceability agent and introspection into the other process. On MacOS, this access is controlled for security reasons. There are two ways to get these tools to function:

The OpenJDK build makefile attempts to sign these commands using a certificate named openjdk_codesign. When Oracle builds binary releases with an authoritative certificate of this name, their binaries should be accepted by all computers recognizing that authority. Alternatively, the individual OpenJDK builder can create a code-sigining certificate that will give authorization on their computers.

Creating A Code-Signing Certificate (courtesy of the lldb project)

Keychain Access->Certificate Assistant->Create a Certificate...

Name = openjdk_codesign
Identity Type = Self Signed Root
Certificate Type = Code Signing

Change:
When using this certificate: Always Trust

The next steps are necessary on SnowLeopard, but are probably because of a bug in how Keychain Access makes certificates. (Note: These also apply for Lion.)

sudo security add-trust -d -r trustRoot -p basic -p codeSign -k /Library/Keychains/System.keychain ~/Desktop/openjdk_codesign.cer