Jetbrains doc for first build - project fails to compile.
I'm following the jetbrains docs for the first build, but getting a compiler error about the maven-compiler-plugin, which I assume is defined in the git project pom. Anyone have a solution?
11:13:03 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project simple: Fatal error compiling: error: release version 11 not supported
Using
https://github.com/mkjetbrains/SimpleMavenSample.git
Please sign in to leave a comment.
It may seem like you are missing JDK or it is not configured.
Please try executing the following command in the command line and share the output:
java --version
If there is no output for JDK, please install it. Please also check if you have JAVA_HOME environment variable set up with the path to installed JDK: https://www.baeldung.com/java-home-on-windows-mac-os-x-linux.
In a case you have further questions, please share the full build log of the failed build. You can upload it to the https://uploads.jetbrains.com/ and share the upload ID to keep it private.
Best regards,
Anton
We do have a JDK installed and seems to be configured. Do you see anything wrong here?
[teamcity@TEAMCITY-01 opt]$ java -version
openjdk version "17.0.10" 2024-01-16 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.10.0.7-1) (build 17.0.10+7-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.10.0.7-1) (build 17.0.10+7-LTS, mixed mode, sharing)
[teamcity@TEAMCITY-01 opt]$ echo $JAVA_HOME
/usr/lib/jvm/java-17-openjdk-17.0.10.0.7-2.el8.x86_64
The output that you have shared seems OK. Please share the full build log of the failed build as requested earlier, I will check it for possible causes.
Best regards,
Anton
I also see in the log, though not listed as an error - complaining about Maven. I didn't install Maven - was that neccessary? I didn't see anything to do with that in the setup guide. Here's an updated snippet - let me see if I can pull the full log.
Here's the full log file
Upload id: 2024_03_04_4kfwDXAf2BwjhpVeaZ68m2 (file: SimpleMavenSample_Build_3 (1).log)
No, Maven installation is not required when running the build step using the Maven Build Runner - it uses the bundled in the Build Agent Maven.
The sample project requires JDK 11 to build. Java is backward-compatible, so it is not expected to encounter this error when JDK 17 is installed, like in your case. But to eliminate this possibility, could you try installing the JDK 11 on the Build Agent machine and see if it will resolve the issue? Please share the build log if it won't help.
Best regards,
Anton
Sure, I added java-11-openjdk.x86_64 to server but did not change the default java on server (17); I assume that is fine. I also restarted the teamcity server though that probably wasn't necessary.
I re-ran the job and still get the same error - here's a log. Thank you for having another look.
Upload id: 2024_03_05_9SdvmqfNxYHBjnm8p7UiFX (file: SimpleMavenSample_Build_5.log)
Anton - I just had a notice that there was a TC server update available to me, so I went ahead and updated (think it included an important security update).
After doing that and restarting, the SimpleMavenSample ran OK
I guess the issue is solved for me. Thanks again!
I'm glad to hear that the issue was resolved. Thank you for using TeamCity!
Best regards,
Anton