On running mvn-version I get the exception UnsupportedClassVersionError received error How do I solve this

0 votes

Once Maven is installed, I tried to execute mvn -version and I get the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma
    ven/cli/MavenCli : Unsupported major.minor version 51.0
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
......

I'm running on jdk1.6 and maven-3.3.3.

How do I solve this problem?

Aug 7, 2018 in Docker by Tyrion anex
• 8,700 points
609 views

1 answer to this question.

0 votes
This happens because your jdk version is outdated.

From the Maven installation page:

Maven 3.3 requires JDK 1.7 or above, Maven 3.2 requires JDK 1.6 or above, while Maven 3.0/3.1 requires JDK 1.5 or above.

You either need to upgrade your JDK to 7 or higher, or downgrade Maven to the 3.2 version.
answered Aug 7, 2018 by Sophie may
• 10,610 points

Related Questions In Docker

0 votes
2 answers
0 votes
1 answer

How do I know which datastore indexes are in error?

There was no public API for managing ...READ MORE

answered Jul 27, 2018 in Docker by ajs3033
• 7,300 points
538 views
0 votes
1 answer

How do I get into a Docker container?

docker attach will let you connect to your ...READ MORE

answered Aug 10, 2018 in Docker by Kalgi
• 52,360 points
598 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,469 views
0 votes
2 answers

How do I fix the “no space left on device” error in docker?

Try cleaning up: $ docker volume rm $(docker ...READ MORE

answered Aug 14, 2019 in Docker by Sirajul
• 59,230 points
12,160 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP