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
AOT-related goals are failing when using java 17 #1009
Comments
I added the project to my GitHub account for your convenience: aotdemo. Funny thing is, the error does not reproduce on a MacBook Pro machine 😟 |
You are running with Java 8 which is not supported by Micronaut 4. |
@alvarosanchez I am sorry but you were too quick to dismiss it. I am NOT using Java 8 , I am using Java 17. Tagging with "cannot reproduce" is just lazy, since you can reproduce it easily on a Windows machine if you bother to clone the aotdemo project and try to build it on a Windows machine. Very dissapointed with the way you handled it. |
@nedelva no need to be so disrespectful. If you care enough to read your own details, you will find that:
So even if you think you are running with Java 17 (class file version 61.0), you are not. You are running with Java 8 (version 52.0). Besides, But if this weren't enough, I did take the time to try to reproduce it locally (look at the timestamps): Nevertheless, you always have the chance to provide more context and/or request for this issue to be reopened. I didn't lock this conversation. Next time, I would appreciate it if you could show more respect for an OSS contributor. |
@alvarosanchez I think my objections still stand. What you are showing me is
None of the above disproves my claims. I urge you to actually try to build the sample project on a Windows machine and you will see that the issue does occur indeed. |
My submissions for the image gallery contest 🥇The project settings, where you can see I use JDK 21 in fact: Also don't forget that is not possible to execute the build with java 8 since the POM specifies the properties <jdk.version>17</jdk.version>
<release.version>17</release.version> See here what running from command prompt gives me. First, I set the But I think the clue to the puzzle can be seen in the second image of the run (see my red underline) @alvarosanchez Here's the trick question for you: If on a Windows machine there are several Java JDK versions installed, which one is picked when the plugin invokes the command (I admit, I unintentionally threw you on a wrong path by forgetting to mention that I have SEVERAL JDKs installed on my machine) |
Running |
I'm glad you finally found out why you were running with Java 8 👍
This has nothing to do with the plugin. Maven (and Gradle, and pretty much all Java applications) will run with the The JDK version in your POM is only meaningful for the Maven Compiler Plugin. This plugin does nothing with it. It allows you to do things like compile with JDK 21 but produce 17 bytecode. Switching |
On a brand new Micronaut Application created with Launcher web application, the
mn:aot-sample-config
goal fails with this output:mn-aot-sample-config output.txt
When running
mvn package
with AOT enabled, themn:aot-analysis
generates pretty much the same thing:mn-aot-analysis output.txt
TL;DR:
How to reproduce: generate a Micronaut application using Launcher. Here's a screenshot of the choices:
Then run either one of the AOT-related goals. [Tested on a Windows 10 Family OS machine, with Java 17 and Maven 3.9.6]
The text was updated successfully, but these errors were encountered: