diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCommandLineBuilder.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCommandLineBuilder.java index ea11d2625c44e..ea06eee48baa9 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCommandLineBuilder.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/DevModeCommandLineBuilder.java @@ -38,7 +38,6 @@ import io.quarkus.deployment.util.CommandLineUtil; import io.quarkus.maven.dependency.ArtifactKey; import io.quarkus.runtime.logging.JBossVersion; -import io.quarkus.runtime.util.JavaVersionUtil; import io.quarkus.utilities.JavaBinFinder; public class DevModeCommandLineBuilder { @@ -137,19 +136,6 @@ protected DevModeCommandLineBuilder(String java) { args.add(javaTool); } - public DevModeCommandLineBuilder preventnoverify(boolean preventnoverify) { - if (!preventnoverify) { - // in Java 13 and up, preventing verification is deprecated - see https://bugs.openjdk.java.net/browse/JDK-8218003 - // this test isn't absolutely correct in the sense that depending on the user setup, the actual Java binary - // that is used might be different that the one running Maven, but given how small of an impact this has - // it's probably better than running an extra command on 'javaTool' just to figure out the version - if (!JavaVersionUtil.isJava13OrHigher()) { - args.add("-Xverify:none"); - } - } - return this; - } - public DevModeCommandLineBuilder forceC2(Boolean force) { forceC2 = force; return this; diff --git a/core/runtime/src/main/java/io/quarkus/runtime/util/JavaVersionUtil.java b/core/runtime/src/main/java/io/quarkus/runtime/util/JavaVersionUtil.java index 68de2b58dd0c3..24c274a89ae49 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/util/JavaVersionUtil.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/util/JavaVersionUtil.java @@ -7,9 +7,7 @@ public class JavaVersionUtil { private static final Pattern PATTERN = Pattern.compile("(?:1\\.)?(\\d+)"); - private static boolean IS_JAVA_13_OR_NEWER; private static boolean IS_GRAALVM_JDK; - private static boolean IS_JAVA_16_OR_OLDER; private static boolean IS_JAVA_17_OR_NEWER; private static boolean IS_JAVA_19_OR_NEWER; private static boolean IS_JAVA_21_OR_NEWER; @@ -23,14 +21,10 @@ static void performChecks() { Matcher matcher = PATTERN.matcher(System.getProperty("java.specification.version", "")); if (matcher.matches()) { int first = Integer.parseInt(matcher.group(1)); - IS_JAVA_13_OR_NEWER = (first >= 13); - IS_JAVA_16_OR_OLDER = (first <= 16); IS_JAVA_17_OR_NEWER = (first >= 17); IS_JAVA_19_OR_NEWER = (first >= 19); IS_JAVA_21_OR_NEWER = (first >= 21); } else { - IS_JAVA_13_OR_NEWER = false; - IS_JAVA_16_OR_OLDER = false; IS_JAVA_17_OR_NEWER = false; IS_JAVA_19_OR_NEWER = false; IS_JAVA_21_OR_NEWER = false; @@ -40,14 +34,6 @@ static void performChecks() { IS_GRAALVM_JDK = (vmVendor != null) && vmVendor.startsWith("GraalVM"); } - public static boolean isJava13OrHigher() { - return IS_JAVA_13_OR_NEWER; - } - - public static boolean isJava16OrLower() { - return IS_JAVA_16_OR_OLDER; - } - public static boolean isJava17OrHigher() { return IS_JAVA_17_OR_NEWER; } diff --git a/core/runtime/src/test/java/io/quarkus/runtime/util/JavaVersionUtilTest.java b/core/runtime/src/test/java/io/quarkus/runtime/util/JavaVersionUtilTest.java index 4e7e79fb0b07e..fea02a08126d9 100644 --- a/core/runtime/src/test/java/io/quarkus/runtime/util/JavaVersionUtilTest.java +++ b/core/runtime/src/test/java/io/quarkus/runtime/util/JavaVersionUtilTest.java @@ -12,28 +12,27 @@ class JavaVersionUtilTest { @Test void testJava8() { testWithVersion("1.8", () -> { - assertFalse(JavaVersionUtil.isJava13OrHigher()); + assertFalse(JavaVersionUtil.isJava17OrHigher()); }); } @Test void testJava11() { testWithVersion("11", () -> { - assertFalse(JavaVersionUtil.isJava13OrHigher()); + assertFalse(JavaVersionUtil.isJava17OrHigher()); }); } @Test void testJava14() { testWithVersion("14", () -> { - assertTrue(JavaVersionUtil.isJava13OrHigher()); + assertFalse(JavaVersionUtil.isJava17OrHigher()); }); } @Test void testJava17() { testWithVersion("17", () -> { - assertTrue(JavaVersionUtil.isJava13OrHigher()); assertTrue(JavaVersionUtil.isJava17OrHigher()); assertFalse(JavaVersionUtil.isJava21OrHigher()); }); @@ -42,7 +41,7 @@ void testJava17() { @Test void testJava21() { testWithVersion("21", () -> { - assertTrue(JavaVersionUtil.isJava13OrHigher()); + assertTrue(JavaVersionUtil.isJava17OrHigher()); assertTrue(JavaVersionUtil.isJava21OrHigher()); }); } diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java index ab174702a915f..6a7217c87d4c4 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java @@ -95,7 +95,6 @@ public abstract class QuarkusDev extends QuarkusTask { private final Property workingDirectory; private final MapProperty environmentVariables; - private final Property preventNoVerify; private final Property forceC2; private final Property shouldPropagateJavaCompilerArgs; private final ListProperty args; @@ -129,9 +128,6 @@ public QuarkusDev( environmentVariables = objectFactory.mapProperty(String.class, String.class); - preventNoVerify = objectFactory.property(Boolean.class); - preventNoVerify.convention(false); - forceC2 = objectFactory.property(Boolean.class); shouldPropagateJavaCompilerArgs = objectFactory.property(Boolean.class); @@ -212,40 +208,12 @@ public Map getEnvVars() { return environmentVariables.get(); } - @Input - public Property getPreventNoVerify() { - return preventNoVerify; - } - - /** - * @return boolean value of getPreventNoVerify() - * @deprecated see {@link #getPreventNoVerify()} - */ - @SuppressWarnings("SpellCheckingInspection") - @Deprecated - @Internal - public boolean isPreventnoverify() { - return getPreventNoVerify().get(); - } - @Input @Optional public Property getForceC2() { return forceC2; } - /** - * @deprecated see {@link #getPreventNoVerify()} - */ - @SuppressWarnings("SpellCheckingInspection") - @Deprecated - @Option(description = "value is intended to be set to true when some generated bytecode is" + - " erroneous causing the JVM to crash when the verify:none option is set " + - "(which is on by default)", option = "prevent-noverify") - public void setPreventnoverify(boolean preventNoVerify) { - getPreventNoVerify().set(preventNoVerify); - } - @Input public ListProperty getJvmArguments() { return jvmArgs; @@ -439,7 +407,6 @@ private DevModeCommandLine newLauncher(final AnalyticsService analyticsService) } } DevModeCommandLineBuilder builder = DevModeCommandLine.builder(java) - .preventnoverify(getPreventNoVerify().getOrElse(false)) .forceC2(getForceC2().getOrNull()) .projectDir(projectDir) .buildDir(buildDir) diff --git a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java index 1ff00812125fd..b4c61c4377408 100644 --- a/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java +++ b/devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java @@ -290,13 +290,6 @@ public class DevMojo extends AbstractMojo { @Parameter(defaultValue = "${project.remotePluginRepositories}", readonly = true, required = true) private List pluginRepos; - /** - * This value is intended to be set to true when some generated bytecode - * is erroneous causing the JVM to crash when the verify:none option is set (which is on by default) - */ - @Parameter(defaultValue = "${preventnoverify}") - private boolean preventnoverify = false; - /** * This value is intended to be set to true when we want to require C2 compilation instead of preventing it from * ever kicking in. @@ -1285,7 +1278,6 @@ private DevModeCommandLine newLauncher(String actualDebugPort, String bootstrapI } final DevModeCommandLineBuilder builder = DevModeCommandLine.builder(java) - .preventnoverify(preventnoverify) .forceC2(forceC2) .buildDir(buildDir) .outputDir(outputDirectory)