未找到主要方法 - JSON 相关

Main Method Not Found - JSON Related

我正在按照 http://www.tutorialspoint.com/json/json_quick_guide.htm

上给出的示例进行操作
import org.json.simple.JSONObject;

class JsonEncodeDemo {

   public static void main(String[] args){
      JSONObject obj = new JSONObject();

      obj.put("name", "foo");
      obj.put("num", new Integer(100));
      obj.put("balance", new Double(1000.21));
      obj.put("is_vip", new Boolean(true));

      System.out.print(obj);
   }
}

我遇到了以下错误: 错误:在classJsonEncodeDemo中找不到Main方法,请将main方法定义为: public static void main(String[] args) 或 JavaFX 应用程序 class 必须扩展 javafx.application.Application

好像是什么问题?

非常感谢。

你能编写用于编译的代码和运行你的程序吗? 我猜可能有错别字。