当前位置: 代码迷 >> J2SE >> 小程序,在dos中运行没有关问题,但是在myeclipse中运行出错,求解释
  详细解决方案

小程序,在dos中运行没有关问题,但是在myeclipse中运行出错,求解释

热度:4469   发布时间:2013-02-25 00:00:00.0
小程序,在dos中运行没问题,但是在myeclipse中运行出错,求解释
其实我是想用这个程序判断象限问题的
Java code
import java.util.*;public class xiangxian {    public static void main(String[] args)    {        float x,y;        Scanner s1 = new Scanner(System.in);        Scanner s2 = new Scanner(System.in);        System.out.println("请输入X的值:");                x = s1.nextFloat();        System.out.println("请输入Y的值:");        y = s2.nextFloat();        if(x>0&&y>0)        {            System.out.println("第一象限");        }        if(x<0&&y>0)        {            System.out.println("第二象限");        }        if(x<0&&y<0)        {            System.out.print("第三象限");        }        if(x>0&&y<0)        {            System.out.println("第四象限");        }        if(x==0)        {            System.out.println("在Y轴上");        }        if(y==0)        {            System.out.println("在X轴上");        }    }}

出错提示是:
java.lang.NoSuchMethodError: main
Exception in thread "main"

------解决方案--------------------------------------------------------
貌似程序本身没问题。
------解决方案--------------------------------------------------------
能运行啊,在MyEclipse上,LZ是不是构建的项目错了。
------解决方案--------------------------------------------------------
程序本身没有问题的,可能是myeclipse的问题吧,
------解决方案--------------------------------------------------------
有时候eclipse和myeclipse或者其他的软件都有莫名其妙的问题,只能换其他的试试了。
  相关解决方案