When we develop Maven jobs utilizing artefacts and try to run, we occasionally get the adhering to error. Source alternative 5 is no longer supported. Use 7 or later on. In this short article, Let’s see the procedures associated to solve the error in the Maven task.
You are watching: Source option 5 is no longer supported. use 6 or later.
The error (Source alternative 5 is no longer supported) is common once we produce a Maven job from the old archekinds. In this case, we must specify the resource and target version to the Maven compiler. We can specify these properties in Maven pom.xml.
The fix for the problem is to use the latest Java atmosphere for the task that is over JDK 7 or Later.
Identify the JDK version mounted on your machine or the version the IDE workspace offers. Update the project develop course through latest library settings.
Right-click Project properties >> Java compiler.
Change the JDK compliance parameters from 1.5 -> 1.7 or above.
See more: Kiss Me Six Pence None The Richer Chords By Sixpence None The Richer
Click on the Execution Environments link and also choose the latest or suitable JDK above JDK 1.7
Sample pom.xml file through JDK 14 version
4.0.0com.carolannpeacock.comTestNGTutorials0.0.1-SNAPSHOT 14 14 org.seleniumhq.selenium selenium-java 4.0.0-alpha-7 org.seleniumhq.selenium selenium-firefox-driver 4.0.0-alpha-7 org.seleniumhq.selenium selenium-edge-driver 4.0.0-alpha-7 org.testng testng 6.8 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5
Verify the fix
Run the Maven job. The error need to be resolved now.
After transforming the settings and also adding the properties indevelopment to the pom.xml file. Verify by running the project. Run As >> Maven Build