Hello world 应用程序构建失败(Eclipse Juno 中的 CodenameOne)

Hello world application build fail (CodenameOne in Eclipse Juno)

按照这里的教程.. https://www.codenameone.com/how-do-i---create-a-basic-hello-world-application--send-it-to-my-device-using-eclipse.html

由于以下行,我构建失败:

b.addActionListener(e -> Dialog.show("Dialog Title", "Hi", "OK", null));

为什么?

编译显示:

java.lang.Error: Unresolved compilation problems: The operator > is undefined for the argument type(s) int, boolean Syntax error on token "-", -- expected

Java 大多数 eclipse IDE 编译器默认不支持 8

通过下载 Eclipse Java8 支持库在 Eclipse Kepler 中工作。

Eclipse + Java 8 support?

CodenameOne 也适用于最新的“Eclipse Neon”,但有一个错误

build.xml:147: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre1.8.0_101"

我为此找到的解决方案是确保 JRE 1.8 库存在于库选项卡(项目属性 - 构建路径 - 库)下,然后点击“应用”按钮 然后是“确定”。