在使用GWT 2.7将Java 7升级到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兼容?
[ERROR] Source level must be one of [auto, 1.6, 1.7]. […] [ERROR] -sourceLevel Specifies Java source level (defaults to auto:1.7)
显式设置-sourceLevel
为1.7
(或1.6
)。
可以<sourceLevel>1.7</sourceLevel>
在org.codehaus.mojo:gwt-maven-plugin的配置中使用,也可以将maven.compiler.source
属性设置为1.7
(这也会配置maven-compiler-plugin)。有关org.codehaus.mojo:gwt-maven-plugin的信息,请参见http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html#sourceLevel。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句