7

在 Eclipse 中编译我的 libgdx 应用程序时,我不断收到此错误:

 [ERROR] Errors in 'file:/C:/Users/Zorfie/Programing/Java/workspace/Libgdx/src/sim/states/BasicBox2DState.java'
      [ERROR] Line 157:  The method nanoTime() is undefined for the type System
      [ERROR] Line 159:  The method nanoTime() is undefined for the type System
      [ERROR] Line 160:  The method nanoTime() is undefined for the type System
      [ERROR] Line 161:  The method nanoTime() is undefined for the type System
   [ERROR] Errors in 'jar:file:/C:/Program%20Files/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201203300216-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/web/bindery/autobean/shared/impl/StringQuoter.java'
      [ERROR] Line 21:  The import org.json cannot be resolved
      [ERROR] Line 69:  JSONObject cannot be resolved
   [ERROR] Errors in 'jar:file:/C:/Program%20Files/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201203300216-rel-r37/gwt-2.4.0/gwt-user.jar!/com/google/web/bindery/autobean/vm/impl/JsonSplittable.java'
      [ERROR] Line 23:  The import org.json cannot be resolved
      [ERROR] Line 24:  The import org.json cannot be resolved
      [ERROR] Line 25:  The import org.json cannot be resolved
      [ERROR] Line 40:  JSONObject cannot be resolved to a type
      [ERROR] Line 47:  JSONObject cannot be resolved to a type

这意味着 GWT 不支持 .nanoTime(),是这种情况还是我只是使用错误的 JRE 运行?(我检查了该项目,它说它是 1.6)。

4

1 回答 1

10

GWT不nanoTime()支持,因为 javascript 不支持它。

GWT 中最接近的类比是Duration.currentTimeMillis()

于 2012-04-06T17:09:46.707 回答