• MAC & Eclipse运行java程序报错:Could not find or load main class


    参看: https://stackoverflow.com/questions/11235827/eclipse-error-could-not-find-or-load-main-class

    If you create a java class with public static void main(String[] args), Eclipse will run that main method for you by right clicking on the file itself, or on the file in the project explorer, then choosing:

    "Run As" -> "Java Application."

    Once you do this, Eclipse stores information about your class, so you can easily run the class again from the Run As menu (Green Play Button on the toolbar) or from the Run Configurations dialog.

    If you subsequently MOVE the java class (manually, or however), then again choose 

    "Run As" -> "Java Application,"

    from the new location, Eclipse will run the original stored configuration, attempt to invoke this class from its original location, which causes this error.

    For me, the fix was to go to the run configurations, (Green Play Button -> Run Configurations) and remove all references to the class. The next time you run 

    "Run As" -> "Java Application" 

    Eclipse will write a new configuration for the moved class, and the error will go away.

  • 相关阅读:
    poj 3621(最优比率环)
    bzoj 1497(最大权闭合子图)
    Dinic(模板 再错是不可能的 这辈子都不可能了)
    BZOJ 2038
    zoj 3822(概率dp)
    poj 3683(2-sat+拓扑排序)
    poj 2186(tarjan+缩点)
    hdu 5782(kmp+hash)
    hdu 6035(树形dp)
    Python爬取房屋租售信息
  • 原文地址:https://www.cnblogs.com/carol-wei/p/7836712.html
Copyright © 2020-2023  润新知