Проблемы с компиляцией набора виджетов после перехода на vaadin8

У меня только что обновился с vaadin 7.7.7 до vaadin 8.3.0. Я добавил пакет совместимости для сервера, тем и клиента. Я могу запустить «чистую установку» или «установить vaadin: update-widgetset», но когда я пытаюсь скомпилировать в eclipse, с набором виджетов vaadin у меня появляется много ошибок. Их много, я вырезал только часть большого FAIL.

[INFO]    Tracing compile failure path for type 'javaemul.internal.HashCodes'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/javaemul/internal/HashCodes.java'
[INFO]          [ERROR] Line 25: The method getStringHashCode(String) in the type HashCodes is not applicable for the arguments (Object)
[INFO]          [ERROR] Line 29: The method hashCode() in the type Boolean is not applicable for the arguments (boolean)
[INFO]    Tracing compile failure path for type 'com.vaadin.client.communication.AtmospherePushConnection'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/communication/AtmospherePushConnection.java'
[INFO]          [ERROR] Line 159: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 153: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 183: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'com.vaadin.client.componentlocator.VaadinFinderLocatorStrategy'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java'
[INFO]          [ERROR] Line 679: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 674: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 672: The method stream(Integer[]) is undefined for the type Arrays
[INFO]          [ERROR] Line 676: The method stream(Integer[]) is undefined for the type Arrays
[INFO]    Tracing compile failure path for type 'com.vaadin.client.ui.VMenuBar'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/ui/VMenuBar.java'
[INFO]          [ERROR] Line 112: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'com.vaadin.client.widgets.Grid'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/widgets/Grid.java'
[INFO]          [ERROR] Line 2954: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6253: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 3887: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6571: The method addColumnsSkipSelectionColumnCheck(Collection<Grid.Column<?,T>>, int) in the type Grid<T> is not applicable for the arguments (Set<C>, int)
[INFO]          [ERROR] Line 6594: The method forEach((<no type> col) -> {}) is undefined for the type Collection<Grid.Column<?,T>>
[INFO]          [ERROR] Line 1033: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 8021: The method addColumnsSkipSelectionColumnCheck(Collection<Grid.Column<?,T>>, int) in the type Grid<T> is not applicable for the arguments (Set<Grid<T>.SelectionColumn>, int)
[INFO]          [ERROR] Line 3897: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6251: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 2957: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 4026: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 2339: The method getCell(Element) in the type RowContainer is not applicable for the arguments (JavaScriptObject)
[INFO]          [ERROR] Line 5988: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 1459: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 3811: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 4074: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 3356: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6508: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 8682: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 1466: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 2946: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 1822: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 1061: The type Grid<T>.EditorRequestImpl<T> must implement the inherited abstract method EditorHandler.EditorRequest<T>.failure(String, Collection<Grid.Column<?,T>>)
[INFO]          [ERROR] Line 6594: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 949: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 4558: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 8681: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6277: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6247: The method setSelectionModel(SelectionModel<T>) in the type Grid<T> is not applicable for the arguments (SelectionModel.NoSelectionModel<Object>)
[INFO]          [ERROR] Line 6591: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 3338: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 1891: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 8681: The method stream() is undefined for the type List<Grid.Column<?,T>>
[INFO]          [ERROR] Line 8977: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6579: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 6591: The method stream() is undefined for the type Collection<Grid.Column<?,T>>
[INFO]          [ERROR] Line 1608: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 592: Type mismatch: cannot convert from ArrayList<Grid.Column<?,capture#36-of ?>> to List<Grid.Column<?,?>>
[INFO]          [ERROR] Line 6579: The method forEach((<no type> col) -> {}) is undefined for the type Collection<Grid.Column<?,T>>
[INFO]          [ERROR] Line 8273: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'java.util.function.IntConsumer'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/util/function/IntConsumer.java'
[INFO]          [ERROR] Line 29: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 33: Cannot refer to the non-final local variable after defined in an enclosing scope
[INFO]          [ERROR] Line 31: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'com.vaadin.client.ui.tabsheet.TabsheetConnector'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/ui/tabsheet/TabsheetConnector.java'
[INFO]          [ERROR] Line 37: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'com.vaadin.client.ui.textfield.ValueChangeHandler'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/ui/textfield/ValueChangeHandler.java'
[INFO]          [ERROR] Line 48: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'com.vaadin.shared.ui.dnd.criteria.Criterion'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-shared/8.3.1/vaadin-shared-8.3.1.jar!/com/vaadin/shared/ui/dnd/criteria/Criterion.java'
[INFO]          [ERROR] Line 180: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 175: The method stream() is undefined for the type Collection<Payload>
[INFO]          [ERROR] Line 180: Type mismatch: cannot convert from Object to boolean
[INFO]          [ERROR] Line 176: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'java.util.Optional'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/util/Optional.java'
[INFO]          [ERROR] Line 45: Type mismatch: cannot convert from Optional<capture#2-of ? extends Object> to Optional<T>
[INFO]          [ERROR] Line 82: Type mismatch: cannot convert from Optional<capture#9-of ? extends U> to Optional<U>
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/util/function/Consumer.java'
[INFO]          [ERROR] Line 33: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 31: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 35: Cannot refer to the non-final local variable after defined in an enclosing scope
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/util/function/Predicate.java'
[INFO]          [ERROR] Line 46: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 32: The target type of this expression must be a functional interface
[INFO]          [ERROR] Line 31: Static methods are allowed in interfaces only at source level 1.8 or above
[INFO]          [ERROR] Line 48: Cannot refer to the non-final local variable other defined in an enclosing scope
[INFO]          [ERROR] Line 43: Cannot refer to the non-final local variable other defined in an enclosing scope
[INFO]          [ERROR] Line 31: Illegal modifier for the interface method isEqual; only public & abstract are permitted
[INFO]          [ERROR] Line 41: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 37: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 48: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 32: Method references are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 38: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 43: Lambda expressions are allowed only at source level 1.8 or above
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/util/function/Function.java'
[INFO]          [ERROR] Line 38: Cannot refer to the non-final local variable after defined in an enclosing scope
[INFO]          [ERROR] Line 30: Static methods are allowed in interfaces only at source level 1.8 or above
[INFO]          [ERROR] Line 41: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 31: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 36: Default methods are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 43: Cannot refer to the non-final local variable before defined in an enclosing scope
[INFO]          [ERROR] Line 30: Illegal modifier for the interface method identity; only public & abstract are permitted
[INFO]          [ERROR] Line 38: Lambda expressions are allowed only at source level 1.8 or above
[INFO]          [ERROR] Line 43: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Tracing compile failure path for type 'java.io.ByteArrayOutputStream'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/google/gwt/gwt-user/2.8.2/gwt-user-2.8.2.jar!/com/google/gwt/emul/java/io/ByteArrayOutputStream.java'
[INFO]          [ERROR] Line 196: The method write(byte[], int, int) of type ByteArrayOutputStream must override or implement a supertype method
[INFO]          [ERROR] Line 214: The method write(int) of type ByteArrayOutputStream must override or implement a supertype method
[INFO]          [ERROR] Line 82: The method close() is undefined for the type OutputStream
[INFO]          [ERROR] Line 76: The method close() of type ByteArrayOutputStream must override or implement a supertype method
[INFO]          [ERROR] Line 231: The method write(byte[], int, int) is undefined for the type OutputStream
[INFO]    Tracing compile failure path for type 'com.vaadin.client.extensions.javascriptmanager.JavaScriptManagerConnector'
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java'
[INFO]          [ERROR] Line 41: Lambda expressions are allowed only at source level 1.8 or above
[INFO]    Finding entry point classes
[INFO]       Tracing compile failure path for type 'com.vaadin.client.ApplicationConfiguration'
[INFO]          [ERROR] Errors in 'jar:file:/C:/Users/cristian.lopez/.m2/repository/com/vaadin/vaadin-client/8.3.1/vaadin-client-8.3.1.jar!/com/vaadin/client/ApplicationConfiguration.java'
[INFO]             [ERROR] Line 466: Lambda expressions are allowed only at source level 1.8 or above
[INFO]             [ERROR] Line 710: Lambda expressions are allowed only at source level 1.8 or above
[INFO]       [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.517 s
[INFO] Finished at: 2018-02-14T16:47:06+01:00
[INFO] Final Memory: 18M/434M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.3.1:compile (default-cli) on project selektron_Rotapick_TestDB: Command [[
[ERROR] C:\Program Files\Java\jdk1.8.0_111\jre\bin\java -Xmx1G -Dgwt.persistentunitcache=false com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:\Users\cristian.lopez\workspace\vaadin_Rotapick_8_Compatibility\target\classes\VAADIN\widgetsets -localWorkers 4 -failOnError -XfragmentCount -1 -sourceLevel auto -gen C:\Users\cristian.lopez\workspace\vaadin_Rotapick_8_Compatibility\target\.generated de.psb_gmbh.visualtools.Visualtools
[ERROR] ]] failed with status 1
[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/MojoExecutionException

Я добавил в свой класс пользовательского интерфейса этот @Widgetset("com.vaadin.v7.Vaadin7WidgetSet")

В моем помпе это то, что у меня есть.

<packaging>war</packaging>
<version>1.00.02</version>
<name>selektron</name>

<prerequisites>
    <maven>3</maven>
</prerequisites>

<properties>
    <vaadin.version>8.3.1</vaadin.version>
    <vaadin.plugin.version>8.3.1</vaadin.plugin.version>
    <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
    <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>

Как видите, в каждой ошибке или почти в каждой из них написано «Лямбда-выражения разрешены только на уровне исходного кода 1.8 или выше».

Я надеюсь, что у кого-то есть идея


person Cristian López González    schedule 14.02.2018    source источник
comment
Вы установили версию Java в pom?   -  person code    schedule 15.02.2018
comment
Какая у вас версия java? JDK-версия? Версия исходного кода? Пожалуйста, предоставьте ваш файл pom.xml.   -  person Steffen Harbich    schedule 15.02.2018
comment
Я отредактировал свой вопрос, в файле pom есть мои свойства. Моя версия JDK — 1.8.0_111. В части сбоя он находится в Program FIles\Java\jdk1.8.0_111...   -  person Cristian López González    schedule 20.02.2018


Ответы (1)


Спасибо, ребята, за быстрый ответ.

Я обнаружил, что существует проблема с vaadin 8 и gwt ниже 2.8 для лямбда-выражений, поэтому мне нужно было обновить мои зависимости gwt с 2.7.0 до 2.8.0 (введите здесь описание ссылки)

person Cristian López González    schedule 21.02.2018