question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mvn compile throws errors

See original GitHub issue

Hello,

I’m working on this guide, but when I run mvn compile I get the following error:

[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.

I’m on OS X. mvn -v shows:

Maven home: /Users/matthuntington/Desktop/apache-maven-3.5.0
Java version: 9, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"

echo $JAVA_HOME shows:

/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home

echo $PATH shows:

/Users/matthuntington/Desktop/apache-maven-3.5.0/bin/:/Users/matthuntington/.rbenv/bin:/Users/matthuntington/.rbenv/shims:/Users/matthuntington/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

any suggestions? Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:23
  • Comments:34 (1 by maintainers)

github_iconTop GitHub Comments

478reactions
mahuntingtoncommented, Oct 17, 2017

Solution: I added

<properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
  </properties>

inside the project tag in pom.xml

28reactions
strzelaczinhocommented, Feb 12, 2018

mahuntington great solution . Just add in pom

<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
 </properties>

and it will compile

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven Compile Error - java - Stack Overflow
The problem is that maven-compiler-plugin in Maven2 by default uses -source 1.3 and target 1.3. You can fix it by adding this to...
Read more >
Fix Maven error in Eclipse: No compiler is provided ... - YouTube
How to fix the error when compiling code using Maven in Eclipse IDE: COMPILATION ERROR... BUILD FAILURE...Failed to execute goal ...
Read more >
How to resolve compiler errors while running Maven Project ...
In this Session no 7 in Maven series, I have explained following topics:(Very IMP for Interviews)Q. How to resolve following errors when ...
Read more >
When compiling a project, Maven throws an error - Ask Ubuntu
With latest maven it is working. mvn -v Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: /opt/maven Java version: 17, ...
Read more >
Maven Errors - CodenBox AutomationLab
Problem: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? ... OR: After adding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found