2012-04-06 9 views
7

में टाइप प्रणाली के लिए अपरिभाषित है ग्रहण में मेरी libgdx आवेदन संकलन जब मैं इस त्रुटि प्राप्त हो रही:विधि nanoTime() GWT

[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() का समर्थन नहीं करता, यह है मामला या मैं बस गलत जेआरई के साथ चल रहा हूँ? (मैंने परियोजना के लिए जांच की और कहा कि यह 1.6 था)।

+0

[ 'System.nanoTime()'] (http://docs.oracle.com/javase/7/docs/api/java/lang/System.html# नैनोटाइम()) जावा 1.5 के बाद जेडीके में रहा है, इसलिए यह निश्चित रूप से ऐसा नहीं है कि आपका जेआरई बहुत पुराना है। –

+0

मुझे स्ट्रिंग.फॉर्मैट के साथ एक ही त्रुटि है। : डी – Emerald214

उत्तर

10

जीडब्ल्यूटी में nanoTime() के लिए कोई समर्थन नहीं है क्योंकि जावास्क्रिप्ट में इसके लिए कोई समर्थन नहीं है।

GWT में निकटतम अनुरूप है Duration.currentTimeMillis()

+2

चलो दस्तावेज़ों के लिए एक लिंक भी जोड़ें: https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation –

 संबंधित मुद्दे