使用GWT2.6将Java 7升级到Java 8

使用GWT2.6将Java 7升级到Java 8,java,maven,gwt,Java,Maven,Gwt,在用GWT2.7将Java7升级到Java8时,我遇到了以下异常。有人能帮我解决这个错误吗 [ERROR] Source level must be one of [auto, 1.6, 1.7]. [ERROR] Google Web Toolkit 2.6.1 [ERROR] Compiler [-logLevel level] [-workDir dir] [-[no]compileReport] [-X[no]checkCasts] [-X[no]classMetadata] [-[no

在用GWT2.7将Java7升级到Java8时,我遇到了以下异常。有人能帮我解决这个错误吗

[ERROR] Source level must be one of [auto, 1.6, 1.7].
[ERROR] Google Web Toolkit 2.6.1
[ERROR] Compiler [-logLevel level] [-workDir dir] [-[no]compileReport] [-X[no]checkCasts] [-X[no]classMetadata] [-[no]draftCompile] [-[no]checkAssertions] [-X[no]closureCompiler] [-XfragmentCount numF
ragments] [-XfragmentMerge numFragments] [-gen dir] [-optimize level] [-[no]saveSource] [-style style] [-[no]failOnError] [-X[no]enforceStrictResources] [-[no]validateOnly] [-sourceLevel [auto, 1.6, 1
.7]] [-localWorkers count] [-war dir] [-deploy dir] [-extra dir] [-saveSourceOutput dir] module[s]
[ERROR]
[ERROR] where
[ERROR]   -logLevel                     The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
[ERROR]   -workDir                      The compiler's working directory for internal use (must be writeable; defaults to a system temp dir)
[ERROR]   -[no]compileReport            Compile a report that tells the "Story of Your Compile". (defaults to OFF)
[ERROR]   -X[no]checkCasts              EXPERIMENTAL: Insert run-time checking of cast operations. (defaults to ON)
[ERROR]   -X[no]classMetadata           EXPERIMENTAL: Include metadata for some java.lang.Class methods (e.g. getName()). (defaults to ON)
[ERROR]   -[no]draftCompile             Compile quickly with minimal optimizations. (defaults to OFF)
[ERROR]   -[no]checkAssertions          Include assert statements in compiled output. (defaults to OFF)
[ERROR]   -X[no]closureCompiler         EXPERIMENTAL: Compile output Javascript with the Closure compiler for even further optimizations. (defaults to OFF)
[ERROR]   -XfragmentCount               EXPERIMENTAL: Limits of number of fragments using a code splitter that merges split points.
[ERROR]   -XfragmentMerge               DEPRECATED (use -XfragmentCount instead): Enables Fragment merging code splitter.
[ERROR]   -gen                          Debugging: causes normally-transient generated types to be saved in the specified directory
[ERROR]   -optimize                     Sets the optimization level used by the compiler.  0=none 9=maximum.
[ERROR]   -[no]saveSource               Enables saving source code needed by debuggers. Also see -debugDir. (defaults to OFF)
[ERROR]   -style                        Script output style: OBF[USCATED], PRETTY, or DETAILED (defaults to OBF)
[ERROR]   -[no]failOnError              Fail compilation if any input file contains an error. (defaults to OFF)
[ERROR]   -X[no]enforceStrictResources  EXPERIMENTAL: Avoid adding implicit dependencies on "client" and "public" for modules that don't define any dependencies. (defaults to OFF)
[ERROR]   -[no]validateOnly             Validate all source code, but do not compile. (defaults to OFF)
[ERROR]   -sourceLevel                  Specifies Java source level (defaults to auto:1.7)
[ERROR]   -localWorkers                 The number of local workers to use when compiling permutations
[ERROR]   -war                          The directory into which deployable output files will be written (defaults to 'war')
[ERROR]   -deploy                       The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the -war directory/jar, and may be the sam
e as the -extra directory/jar)
[ERROR]   -extra                        The directory into which extra files, not intended for deployment, will be written
[ERROR]   -saveSourceOutput             Overrides where source files useful to debuggers will be written. Default: saved with extras.
[ERROR] and
[ERROR]   module[s]                     Specifies the name(s) of the module(s) to compile
[INFO] ------------------------------------------------------------------------
...

GWT 2.6是否与Java 8兼容?

错误告诉您:

[错误]源级别必须是[auto,1.6,1.7]之一


GWT将从版本2.8开始支持Java8。

如果无法升级GWT版本,则需要在项目
pom.xml
中指定编译的源代码级别

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

1.7
1.7
明确地将
-sourceLevel
设置为
1.7
(或
1.6


可以使用org.codehaus.mojo:gwt-maven插件配置中的
1.7
,或者将
maven.compiler.source
属性设置为
1.7
(这也将配置maven编译器插件)。请参阅org.codehaus.mojo:gwt-maven插件。

它不重复。。我想解决上述问题。如何解决?@mohammed如果它解决了您的问题,您应该接受这个答案
[ERROR] Source level must be one of [auto, 1.6, 1.7].
[…]
[ERROR]   -sourceLevel                  Specifies Java source level (defaults to auto:1.7)