Error mvn clean install in my linux machine to build a maven Project

0 votes

Hi Team , I ran "mvn clean install" in my linux machine to build a maven Project, But getting below error:

[ERROR] com/porterhead/sms/DefaultSmsServiceTest has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process

Here is my code:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

   <modelVersion>4.0.0</modelVersion>

   <groupId>com.porterhead</groupId>
   <artifactId>sms-service-parent</artifactId>
   <version>1.0.0</version>
   <packaging>pom</packaging>

   <name>sms-service-parent</name>

   <modules>
       <module>sms-openapi</module>
       <module>sms-service</module>
       <module>component-test</module>
   </modules>

</project>

How to solve this error?? Any help?

Aug 6, 2020 in Linux Administration by Niroj
• 82,880 points
2,788 views

1 answer to this question.

0 votes

Hello @Niroj ,

You need to double check the PATH environment setting.Please make sure you have the bin subdirectory for the latest JDK version at the top of the PATH list.

java.exe executable is in C:\Program Files\Java\jdk-13\bin directory, so that is what you need to have in PATH.

Use this tool to quickly verify or edit the environment variables on Windows. It allows to reorder PATH entries. It will also highlight invalid paths in red.

If you want your code to run on lower JDK versions as well, change the target bytecode version in the IDE. What happens is that you build the code with Java 13 and 13 language level bytecode (target) and try to run it with Java 8 which is the first (default) Java version according to the PATH variable configuration.

The solution is to have Java 13 bin directory in PATH above or instead of Java 8. On Windows you may have C:\Program Files (x86)\Common Files\Oracle\Java\javapath added to PATH automatically which points to Java 8 now:

javapath

If it's the case, remove the highlighted part from PATH and then logout/login or reboot for the changes to have effect. You need to Restart as administrator first to be able to edit the System variables (see the button on the top right of the system variables column).

Hope it is helpfull!!
Thank you!!

answered Aug 6, 2020 by anonymous
• 82,880 points

Related Questions In Linux Administration

0 votes
1 answer

How to create a symlink in Linux?

To create a symbolic link, you can ...READ MORE

answered Feb 1, 2019 in Linux Administration by Omkar
• 69,210 points
840 views
0 votes
1 answer

Error when trying to install a few packages on ubuntu

Try executing the following commands and try ...READ MORE

answered Mar 15, 2019 in Linux Administration by Jobin
1,386 views
0 votes
1 answer

Linux: Finding all storage devices attached to a machine

Use /proc/partitions first. This will list all ...READ MORE

answered Jun 10, 2019 in Linux Administration by Upasana
• 8,620 points
559 views
0 votes
1 answer

How to find the group associated with a user in linux?

To list all the groups groups or to list ...READ MORE

answered Jun 21, 2019 in Linux Administration by DareDev
• 6,890 points
765 views
0 votes
2 answers

How do I use a shell script to SSH in to a remote machine to execute commands?

Sorry in advance for any formatting. Check out ...READ MORE

answered Feb 7, 2021 in Linux Administration by anonymous
16,744 views
0 votes
1 answer

How to create one new partition in my hard disk in Linux?

Hi@akhtar, To create new partition you can follow ...READ MORE

answered Apr 7, 2020 in Linux Administration by MD
• 95,440 points
992 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,527 views
+2 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