You can also enable debugging and configure debug options with registry settings. The registry keys connected with the Microsoft VM debugging interfaces are HKEY_LOCAL_MACHINE\Software\Microsoft\Java VM and HKEY_CURRENT_USER\Software\Microsoft\Java VM.
Note the space between Java and VM in the name of this registry key.
Under this key, you can enter or modify the following entries and values:
Debug
When this key exists before the Microsoft VM begins execution, debugging will be enabled.
DebuggingFlags
Set this value to a DWORD that indicates the value of the debug options.
Note the space between Java and VM in the name of this registry key.
Under this key, you can enter or modify the following entries and values:
EnableFI
Set this value to a DWORD that indicates whether the fast interpreter is enabled. A non-zero value enables the fast interpreter, while a value of 0 (zero) disables it. The fast interpreter is enabled by default.
EnableJIT
Set this value to a DWORD that indicates whether the JIT compiler is enabled. A non-zero value enables the JIT compiler, while a value of 0 (zero) disables it. The JIT compiler is enabled by default.
You can set registry values in code similar to the following:
const char s_cszDebugKey[] = "Software\\Microsoft\\Java VM\\Debug"; // Create the Microsoft VM Debug key. // Return TRUE on success; FALSE on failure. BOOL CreateDebugKey(void) { BOOL bResult = FALSE; HKEY hkeyDebug; DWORD dwDisposition; If (RegCreateKeyEx(HKEY_LOCAL_MACHINE, s_cszDebugKey, 0, NULL, 0, KEY_WRITE, NULL, &hkeyDebug, &dwDisposition) == ERROR_SUCCESS) { bResult = TRUE; RegCloseKey(hkeyDebug); } return(bResult); }
Use these registry settings carefully. These settings affect all Java applications, applets, and COM objects started under the Microsoft VM. Enabling debugging disables certain optimizations in the Microsoft VM, invokes a slower than usual version of the Java bytecode interpreter, and requires more resources. If the Debug registry entry is not explicitly removed when debugging is no longer needed, performance of all Java applications, applets, and COM objects will be slower.
Remove registry settings with code such as the following:
// Delete the Microsoft VM Debug key. // Return TRUE on success; FALSE on failure. BOOL DeleteDebugKey(void) { return(RegDeleteKey(HKEY_LOCAL_MACHINE, s_cszDebugKey) == ERROR_SUCCESS ? TRUE : FALSE); }
You can also add, remove, or modify registry settings with the Regedit.exe utility that is included with Windows 95 and Windows NT.