snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

It's not possible to use QuarkusIntegrationTest in case default Java version is less than 11 #416

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

If you use quarkus-maven-plugin then QuarkusIntegrationTest allows to execute quarkus in a separate JVM using java command. The setup can be this:

The result is : maven and everything inside it is executed using Java 11 as required for Quarkus. But integration test executes java command disregarding maven: it runs a separate process. I see this in DefaultJarLauncher:

List<String> args = new ArrayList<>();
        args.add("java");

So it's just java command .

Everything works fine at the same time if you use QuarkusTest: the same JVM is used to run maven and quarkus.

So if you have working QuarkusTest and decides to make it QuarkusIntegrationTest then test may become broken.

The setup when some specific Java is used to run maven and another Java is a system default Java is a generic case for Continuous integration servers.

Expected behavior

There is a way to run proper java process: it either should somehow get info about Java from Maven (e.g. using JAVA_HOME) or it may provide a way to set the path to the Java command (or both).

Actual behavior

System default java command is used which may have a version below 11.

How to Reproduce?

There will be an exception

Exception in thread "main" java.lang.UnsupportedClassVersionError: io/quarkus/bootstrap/runner/QuarkusEntryPoint has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[13:24:44][Step 3/3]    at java.lang.ClassLoader.defineClass1(Native Method)

Output of uname -a or ver

Linux, version 4.14.225-169.362.amzn2.x86_64

Output of java -version

Java 8

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.2.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response


https://github.com/quarkusio/quarkus/issues/20049


$upstream:20049$