我正在使用LibGDX库编写一些东西(地图生成器),它可以使用GWT构建可部署的HTML5。
但是,当我运行Gradle构建时,我收到此错误:
:html:compileGwt
Compiling module technology.rocketjump.undermount.mapgen.GdxDefinition
Validating units:
[ERROR] Errors in 'file:/D:/workspace/undermount-mapgen/core/src/main/java/technology/rocketjump/undermount/mapgen/generators/RiverGenerator.java'
[ERROR] Line 61: RiverPathfindingCalculator cannot be resolved to a type
[ERROR] Line 89: The left-hand side of an assignment must be a variable
错误似乎表示RiverGenerator.java
中的以下行private boolean runRiver(GridPoint2 startPoint, GridPoint2 endPoint, GameMap map) {
RiverPathfindingCalculator pathfinder = new RiverPathfindingCalculator(startPoint, endPoint, map);
List<GridPoint2> path = pathfinder.findPath();
但是RiverPathfindingCalculator
只是同一个项目中的另一个Java类。它似乎也在文件中正确导入,这里是RiverGenerator
package technology.rocketjump.undermount.mapgen.generators;
import com.badlogic.gdx.math.GridPoint2;
import technology.rocketjump.undermount.mapgen.calculators.RiverPathfindingCalculator;
import technology.rocketjump.undermount.mapgen.model.TileType;
import technology.rocketjump.undermount.mapgen.model.output.*;
import java.util.*;
你可以view the relevant code on Github。关于我做错了什么或如何解决这个问题的任何想法?
答案 0 :(得分:3)
GWT&lt;版本2.8不支持java8语法,因此没有lambda表达式。
将lambda重写为“普通”比较器(大多数IDE都有自动执行重构),GWT应该很高兴。