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,720 points
720 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,720 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 Jan 31, 2019 in Linux Administration by Omkar
• 69,130 points
250 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
557 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
116 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 20, 2019 in Linux Administration by DareDev
• 6,890 points
257 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 in Linux Administration by anonymous
9,022 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,180 points
144 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,076 views
+2 votes
1 answer