diff --git a/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java b/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java index 2be886ad1..39ee41e91 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/klass100/RedefineCommand.java @@ -120,6 +120,12 @@ public class RedefineCommand extends AnnotatedCommand { } try { + if (definitions.isEmpty()) { + process.write("These classes are not found in the JVM and may not be loaded: " + bytesMap.keySet() + + "\n"); + process.end(); + return; + } inst.redefineClasses(definitions.toArray(new ClassDefinition[0])); process.write("redefine success, size: " + definitions.size() + "\n"); } catch (Exception e) {