Maven - JAVA_HOME location and Compilation failure executing javac
<p>---skippable part---</p>

<p>Hi all, first time here and hopefully I'm not writing a clone of anything else. I spent days looking for cases like mine and all the things I tried failed to work, or couldn't simply find the correct solution for me.</p>

<p>I'm trying to use Maven on another student's project I'm working on (have to continue what he already did) for a school project, on a pc with Ubuntu 14.04. I'm in my project directory downloaded from github and I need to create a .war file and use that for Tomcat.
I was following a guide of that student, and probably I'm a little confused on what to do.</p>

<p>---tl:dr i need help---</p>

<p>So when I launch <em>mvn -version</em>, I get this:</p>

<blockquote>
  <p>Java version: 1.7.0_101, vendor: Oracle Corporation Java home:
  /usr/lib/jvm/java-7-openjdk-amd64/jre Default locale: it_IT, platform
  encoding: UTF-8 OS name: "linux", version: "3.19.0-58-generic", arch:
  "amd64", family: "unix"</p>
</blockquote>

<p>Few days ago I had problems with $JAVA_HOME environment variable and probably solved it managing the /etc/environment file, in fact I don't get any error about this. Now when I do a <em>mvn package</em> I get</p>

<blockquote>
  <p>[INFO] Scanning for projects... [INFO]<br>
  [INFO]
  ------------------------------------------------------------------------ [INFO] Building GWT Maven Archetype 2.6.0-SNAPSHOT [INFO]
  ------------------------------------------------------------------------ [INFO]  [INFO] --- maven-enforcer-plugin:1.3.1:enforce
  (enforce-versions) @ webprotege --- [INFO]  [INFO] ---
  gwt-maven-plugin:2.7.0:generateAsync (default) @ webprotege --- [INFO]
  [INFO] --- build-helper-maven-plugin:1.8:add-source (add-source) @
  webprotege --- [INFO] Source directory:
  /home/wapaolo/Documenti/data/webprotege/webprotege/target/generated-sources/gwt
  added. [INFO]  [INFO] --- maven-resources-plugin:2.3:resources
  (default-resources) @ webprotege --- [INFO] Using 'UTF-8' encoding to
  copy filtered resources. [INFO] Copying 10 resources [INFO]  [INFO]
  --- maven-compiler-plugin:2.3.2:compile (default-compile) @ webprotege --- [INFO] Compiling 1744 source files to /home/wapaolo/Documenti/data/webprotege/webprotege/target/webprotege-2.6.0-SNAPSHOT/WEB-INF/classes
  [INFO] -------------------------------------------------------------
  [ERROR] COMPILATION ERROR :  [INFO]
  ------------------------------------------------------------- [ERROR] Failure executing javac, but could not parse the error: javac: invalid
  target release: 1.8 Usage: javac   use -help
  for a list of possible options</p>
  
  <p>[INFO] 1 error [INFO]
  ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
  ------------------------------------------------------------------------ [INFO] Total time: 5.241s [INFO] Finished at: Mon May 09 16:54:04 CEST
  2016 [INFO] Final Memory: 18M/295M [INFO]
  ------------------------------------------------------------------------ [ERROR] Failed to execute goal
  org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
  (default-compile) on project webprotege: Compilation failure [ERROR]
  Failure executing javac, but could not parse the error: [ERROR] javac:
  invalid target release: 1.8 [ERROR] Usage: javac   [ERROR] use -help for a list of possible options [ERROR] ->
  [Help 1] [ERROR]  [ERROR] To see the full stack trace of the errors,
  re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X
  switch to enable full debug logging. [ERROR]  [ERROR] For more
  information about the errors and possible solutions, please read the
  following articles: [ERROR] [Help 1]
  <a href="http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException" rel="nofollow">http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException</a></p>
</blockquote>

<p>So what should I do to proceed now? I've no clue..</p>