2016-05-09 18 views
-1

--- überspringbarer Teil ---Maven - JAVA_HOME Lage und Compilation Ausfall Javac Ausführung

Hallo zusammen, zum ersten Mal hier und hoffentlich ich bin kein Klon von irgendetwas anderes zu schreiben. Ich verbrachte Tage damit, nach Fällen wie meiner zu suchen, und all die Dinge, die ich versuchte, funktionierten nicht oder konnten nicht einfach die richtige Lösung für mich finden.

Ich versuche, Maven auf einem anderen Studentenprojekt zu verwenden, an dem ich arbeite (muss fortfahren, was er bereits getan hat) für ein Schulprojekt, auf einem PC mit Ubuntu 14.04. Ich bin in meinem Projektverzeichnis von Github heruntergeladen und ich muss eine WAR-Datei erstellen und diese für Tomcat verwenden. Ich folgte einem Führer dieses Studenten, und wahrscheinlich bin ich ein wenig verwirrt, was zu tun ist.

--- tl: dr i Hilfe benötigen ---

Also, wenn ich starten mvn -Ausführung, bekomme ich diese:

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"

Vor wenigen Tagen hatte ich Probleme mit $ JAVA_HOME Umgebungsvariable und wahrscheinlich löste es die Verwaltung der/etc/environment-Datei, in der Tat bekomme ich keinen Fehler darüber. Nun, wenn ich ein mvn Paket tun I

[INFO] Scanning for projects... [INFO]
[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

[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] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Also, was soll ich jetzt tun, um fortzufahren? Ich habe keine Ahnung ..

Antwort

1

Ihr Maven-Projekt will Java 1.8, aber Ihr Compiler ist 1.7. Schauen Sie in die pom.xml Datei für so etwas wie

<configuration> 
    <source>1.8</source> 
    <target>1.8</target> 
</configuration> 

und ändern, dass auf 1,7 oder laden Sie die 1,8 jdk.