Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my java application but I am facing following error java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo in Java. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How This Error Occurs ?
I am trying to run my java application but I am facing following error.
Error injecting: org.apache.maven.plugin.war.WarMojo com.google.inject.ProvisionException: Unable to provision, see the following errors:
Error injecting constructor, java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.<init>(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo
How To Solve java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo Error ?
How To Solve java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo Error ?
To Solve java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo Error Just configure war plugin in your POM.xml. Second one is Just Change your JDK for particular Project. Follow this step. First of all Left-click on your project.Then, Select Properties.now, Select Build.Select compile.Change the JDK to version 14.If you don’t have JDK 14 then The download of the JDK is here.Now, Your issue will be fix.
java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo
To Solve java.lang.ExceptionInInitializerError at org.apache.maven.plugin.war.WarMojo.(Unknown Source) while locating org.apache.maven.plugin.war.WarMojo Error Just configure war plugin in your POM.xml. Second one is Just Change your JDK for particular Project. Follow this step. First of all Left-click on your project.Then, Select Properties.now, Select Build.Select compile.Change the JDK to version 14.If you don’t have JDK 14 then The download of the JDK is here.Now, Your issue will be fix.
Solution 1: configure war plugin
Just configure war plugin in your POM.xml like this.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
Solution 2: Change JDK for your project
Just Change your JDK for particular Project. Follow this step.
- First of all Left-click on your project.
- Then, Select Properties.
- now, Select Build.
- Select compile.
- Change the JDK to version 14.
- If you don’t have JDK 14 then The download of the JDK is here.
- Now, Your issue will be fix.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read