Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading Java 7 to Java 8 using GWT 2.6

Tags:

java

maven

gwt

While Upgrading Java 7 to Java8 with GWT 2.7,I am Getting the below Exception.Can any one help me to solve this error

[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] ------------------------------------------------------------------------
...

Will GWT 2.6 is compatible with Java 8?

like image 820
mohammed sameen Avatar asked Apr 28 '15 09:04

mohammed sameen


1 Answers

[ERROR] Source level must be one of [auto, 1.6, 1.7].
[…]
[ERROR]   -sourceLevel                  Specifies Java source level (defaults to auto:1.7)

Set -sourceLevel to 1.7 (or 1.6) explicitly.

That can be done using either <sourceLevel>1.7</sourceLevel> in the configuration for the org.codehaus.mojo:gwt-maven-plugin, or setting the maven.compiler.source property to 1.7 (this will also configure the maven-compiler-plugin). See http://mojo.codehaus.org/gwt-maven-plugin/compile-mojo.html#sourceLevel for the org.codehaus.mojo:gwt-maven-plugin.

like image 164
Thomas Broyer Avatar answered Sep 23 '22 21:09

Thomas Broyer