gpt4 book ai didi

gwt - GWT 中的 System 类型的 nanoTime() 方法未定义

转载 作者:行者123 更新时间:2023-12-04 11:12:28 25 4
gpt4 key购买 nike

在 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)。

最佳答案

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

GWT 中最接近的模拟是 Duration.currentTimeMillis()

关于gwt - GWT 中的 System 类型的 nanoTime() 方法未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10046614/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com