无法将断言解析为类型 - 面向 RCP 开发人员的 Eclipse Helios

Assert cannot be resolved to a type - Eclipse Helios for RCP Developers

以下错误使我的项目无法 运行:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
  assert cannot be resolved to a type
  Syntax error on token ".", ; expected
  The method holdsLock(Logging[]) is undefined for the type Logging
  at org.geotools.util.logging.Logging.getLogging(Logging.java:183)
  at org.geotools.util.logging.Logging.getLogging(Logging.java:170)
  at org.geotools.util.logging.Logging.<clinit>(Logging.java:78)
  at myproject.RasterTest.<init>(RasterTest.java:57)
  at myproject.RasterTest.main(RasterTest.java:318)`

geotools 库所需的日志记录工具在 类 中有许多 eclipse 无法识别的 assert 语句。

我在 SO 上看到了一些类似的问题,建议将字符串 -ea 输入
Windows -> Preferences -> Java -> Installed JREs -> jdk1.7.0_51 -> Edit -> Default VM Arguments,但我做到了无济于事。


抛出错误的行:

public class RasterTest extends ViewPart {
  ...
  protected final Logger LOGGER =  
    org.geotools.util.logging.Logging.getLogger("org.geotools.factory");
  ...
}

我找到了解决方案:

而不是输入字符串-ea Windows -> Preferences -> Java -> Installed JREs -> jdk1.7.0_51 -> Edit -> Default VM Arguments

我输入了字符串-ea Right Click on ProjectName in Project Window -> Run as -> Run Configurations -> ProjectName.product -> Arguments -> Default VM Arguments

如果有人知道为什么第二个有效,但第一个无效,我很想知道为什么。