diff --git a/core/src/main/java/org/teavm/vm/TeaVM.java b/core/src/main/java/org/teavm/vm/TeaVM.java index 1da4fa2d3..4e6d999d3 100644 --- a/core/src/main/java/org/teavm/vm/TeaVM.java +++ b/core/src/main/java/org/teavm/vm/TeaVM.java @@ -548,7 +548,13 @@ public class TeaVM implements TeaVMHost, ServiceRepository { } } - addInitializersToEntryPoint(classes, new MethodReference(entryPoint, CLINIT_DESC)); + var initializers = target.getInitializerMethods(); + if (initializers == null) { + initializers = List.of(new MethodReference(entryPoint, CLINIT_DESC)); + } + for (var initializer : initializers) { + addInitializersToEntryPoint(classes, initializer); + } } private void addInitializersToEntryPoint(ClassHolderSource classes, MethodReference methodRef) {