Handle the Error “unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)”

Java is a programming language that all programmers and developers are aware of. It is the ideal language for designing web applications, mobile applications, desktop applications, games, etc. It is popularly known for being a class-based, high-level as well as object-oriented language. Every now and then Java updates are announced and programmers keep reading to learn the new advancement they can implement in their projects. Java is like the heart of the programming world and programmers can’t imagine working without it. Even beginners and learners try various small to medium projects to become a pro. When working with Java, you may experience the error “unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)”.

You don’t need to panic when you face the error as we are here to assist you to tackle the error. Have a look at how the error occurs

How do you land in the error?

When you try to update the Android S project, you get the error message. This is what you get in return

Caused by: java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)

    at com.sun.tools.javac.util.Assert.error(Assert.java:133)

    at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)

Now that you know what the error message looks like, let’s figure out how to tackle it

How To Remove the Error “unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)”

We have a few ways to help you get rid of the error. You can choose the way that meets the need of your project.

Option 1 – Upgrade the container’s JDK version

To solve the error efficiently, you need to update the container’s JDK version. It is one of the simplest and easiest ways to tackle Java error. The version you will be needing is OpenJDK-11, so switch the JDK container version to OpenJDK-11. Once you update it, you will get to see that the error vanishes.  

Whenever you get the error, the first thing to try is to update the version.

Option 2 – Update gradle JDK in AS Arctic Fox

Another option to resolve the error message is also an upgradation process. In order to update the gradle JDK, you need to use a command that can simply help you do it. You need to follow the below steps to update

Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK

You just need to choose 11 to resolve the error warning. You can easily run your program after implementing this option.

Conclusion

In this post, we highlighted the options to handle the error warning “unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)”. You can simply update the version to get rid of the error warning. No matter how tough the error seems, you can simply solve it.

I hope you find it helpful! I wish you good luck!

For assistance, don’t hesitate to reach out to us by commenting in the box below. We reach back to you to help you.

Leave a Reply

Your email address will not be published. Required fields are marked *