diff --git a/src/main/java/dev/jbang/net/JdkProvider.java b/src/main/java/dev/jbang/net/JdkProvider.java index 79140c1f9..8265a4aaa 100644 --- a/src/main/java/dev/jbang/net/JdkProvider.java +++ b/src/main/java/dev/jbang/net/JdkProvider.java @@ -121,9 +121,11 @@ default Jdk createJdk(@Nonnull String id, @Nullable Path home, @Nonnull String v default String name() { String nm = getClass().getSimpleName(); - // TODO: this 11 is here assuming it ends in "JdkProvider" - dont make that - // broken assumption - return nm.substring(0, nm.length() - 11).toLowerCase(); + if(nm.endsWith("JdkProvider")) { + return nm.substring(0, nm.length() - 11).toLowerCase(); + } else { + return nm.toLowerCase(); + } } /**