diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java index 6529b1ad755d..22044db01bc3 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java @@ -612,6 +612,7 @@ void addImageBuilderJavaArgs(Collection javaArgs) { } void addImageBuilderArg(String arg) { + imageBuilderArgs.remove(arg); imageBuilderArgs.add(arg); } @@ -628,7 +629,7 @@ void addCustomJavaArgs(String javaArg) { } void addCustomImageBuilderArgs(String arg) { - imageBuilderArgs.add(arg); + addImageBuilderArg(arg); customImageBuilderArgs.add(arg); }