Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
denis-anisimov opened this issue Sep 10, 2021 · 4 comments · Fixed by #20050
Assignees
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@denis-anisimov
Copy link

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:

  • default Java version is 8
  • maven is executed with Java 11 (e.g. via setting $JAVA_HOME).

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?

  • Set Java 8 as a default Java.
  • Set JAVA_HOME to JDK 11.
  • Make a project with quarkus-maven-plugin
  • Make an integration test using QuarkusIntegrationTest.
  • Run it.

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

@denis-anisimov denis-anisimov added the kind/bug Something isn't working label Sep 10, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 10, 2021

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Sep 10, 2021

Good point! #20050 should fix the issue

@denis-anisimov
Copy link
Author

Very fast. Thank a lot !

@geoand
Copy link
Contributor

geoand commented Sep 10, 2021

YW!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants