WARNING] Error injecting: org.apache.felix.bundleplugin.BundlePlugin
java.lang.UnsupportedClassVersionError: aQute/bnd/osgi/Analyzer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
hi folks,
I recently started getting these messages while my AEM 6.5 build error.
My JDK is 11.
Where did the aQute/bnd/osgi/Analyzer in Java 17 come from?
Any ideas?
thanks Fiona
Solved! Go to Solution.
Views
Replies
Total Likes
Looking at the change log of maven-bundle-plugin - https://github.com/apache/felix-dev/blob/master/tools/maven-bundle-plugin/changelog.txt
The latest release 6.0.0 needs minimum java 17 so to resolve the issue you would need to update the maven-bundle-plugin to 5.1.9 or lower in the parent pom.xml.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.xxx.xxx</Bundle-SymbolicName>
<Sling-Model-Packages>
com.xxxx.models
</Sling-Model-Packages>
<!-- <Embed-Dependency>json|nimbus-jose-jwt|tink;scope=compile;inline=true</Embed-Dependency> -->
<Embed-Dependency>json</Embed-Dependency>
</instructions>
</configuration>
</plugin>
Also if you are curious to learn more about this, do check out the announcement in adapt to - https://adapt.to/2024/schedule/aem-65-and-java-17
Thanks
Narendra
Are you trying to compile with Cloud Manager or is this error happening in your local. If its cloud manager please check the the maven compiler plugin to JDK 11 and include the maven tool chain plugin in the main pom.xml.
If its local can you try your local pom.xml for JDK 11 and also clear the M2 directory pertianing to aQute/bnd/osgi/Analyzer package.
Regards,
Rajashankar.R
Thanks Rajashankar, I use Cloud Manager for builds but my AEM is not in the cloud, it is AMS.
Just to clarify, when I am building locally, what should I have ? and where ? I have a Java 11 JAVA_HOME but I build in
an IDE that I set to SDK Java 11 for the project.
I have a settings.xml file in my .m2 directory that points to Adobe repos but that is all. Should I add something else in there.?
Or should I have another "local" profile in my AEM project top pom.xml.?
Up to now, I just used whatever came out of the archetype 4 years ago and it never seemed to give any problems.....
Views
Replies
Total Likes
@RajaShankar I am also facing the same issue it used to work fine. This issue started happening suddenly on local build. Cloud manager builds are fine. Also my other teammates are not facing this issue.
Any help here would be appreciated.
Thanks
Last Release on Nov 27, 2024
I see from the Maven repo, that something was changed a few days ago. I wonder did that break things ...
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Fionas,
Will be good if you post the pom details and do you have the maven plugin?
maven-bundle-plugin
Thanks Kamalakannank for lookung at this.
I have attached 3 poms,
the main poml.xml
The aem.all pom.xml
The core pom.xml
When I am running locally I use the profile "autoInstallPackage"
I use maven-bundle-plugin 6.0.0
Can you try with maven-bundle-version with 5.1.1? We had same issue I used this version to overcome it.
I don't know how to change the version of org.apache.felix maven-bundle-plugin .
I configure it, but it has no version.
It is coming from somewhere and is in my .m2/repository/org/apache/felix/
which has jar files from felix-parent, utils, scr.generator, scr.annotations,maven-bundle-plugin, bundlerepository,
maven-scr-plugin...
Views
Replies
Total Likes
Looking at the change log of maven-bundle-plugin - https://github.com/apache/felix-dev/blob/master/tools/maven-bundle-plugin/changelog.txt
The latest release 6.0.0 needs minimum java 17 so to resolve the issue you would need to update the maven-bundle-plugin to 5.1.9 or lower in the parent pom.xml.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.4</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.xxx.xxx</Bundle-SymbolicName>
<Sling-Model-Packages>
com.xxxx.models
</Sling-Model-Packages>
<!-- <Embed-Dependency>json|nimbus-jose-jwt|tink;scope=compile;inline=true</Embed-Dependency> -->
<Embed-Dependency>json</Embed-Dependency>
</instructions>
</configuration>
</plugin>
Also if you are curious to learn more about this, do check out the announcement in adapt to - https://adapt.to/2024/schedule/aem-65-and-java-17
Thanks
Narendra
Thanks for your reply @narendragandhi Changing the maven bundle pulgin version to 5.1.4 resolved my local build issue
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.4</version>
Thanks! It is building now!
Changing the maven bundle plugin version worked for me as well, thanks @narendragandhi
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies