// Set command set. "1" - is ID of VirtualMachine Command Set
commandPacket
.setCommandSet(JDWPCommands.VirtualMachineCommandSet.CommandSetID);
// Send packet
ReplyPacket replyPacket = checkReply(performCommand(commandPacket));
targetVMCapabilities = new Capabilities();
// Set capabilities
targetVMCapabilities.canWatchFieldModification = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canWatchFieldAccess = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetBytecodes = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetSyntheticAttribute = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetOwnedMonitorInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetCurrentContendedMonitor = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetMonitorInfo = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canRedefineClasses = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canAddMethod = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canUnrestrictedlyRedefineClasses = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canPopFrames = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.canUseInstanceFilters = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canGetSourceDebugExtension = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canRequestVMDeathEvent = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.canSetDefaultStratum = replyPacket
.getNextValueAsBoolean();
targetVMCapabilities.reserved16 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved17 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved18 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved19 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved20 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved21 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved22 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved23 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved24 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved25 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved26 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved27 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved28 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved29 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved30 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved31 = replyPacket.getNextValueAsBoolean();
targetVMCapabilities.reserved32 = replyPacket.getNextValueAsBoolean();
return replyPacket;
}