While compiling my libgdx application in eclipse I keep getting this error:
[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
Which implies that GWT does not support .nanoTime(), is this the case or am I simply running with the wrong JRE? (I checked for the project and it said it was 1.6).
There is no support for nanoTime()
in GWT since there is no support for it in javascript.
The closest analog in GWT is Duration.currentTimeMillis()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With