No Source Code is available for type java.text.SimpleDateFormat: GWT Compilation Error

gwt, java

Solution

`SimpleDateFormat` is not available in GWT. Use com.google.gwt.i18n.client.DateTimeFormat instead.

Problem

I was trying to make a GWT application. Then I got some errors when using SimpleDateFormat class in client and shared side. ``` [ERROR] [gwtfirst] Line 381: No source code is available for type java.text.SimpleDateFormat; did you forget to inherit a required module? ``` following is my code in client side: ``` SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Window.alert(sdf.format(usersList.get(30).getCreatedate())); ``` But I can use SimpleDateFormat with server side... I'm wondering if I can't use SimpleDateFormat in client or shared side?

Original source