下面是我的代码,我在cmd或者用Jcreator运行时都能运行,但是用Eclipse不行,我的eclipse应该没设置错,我直接用eclipse编写的程序可以运行。
import javax.swing.*;
import java.awt.*;
public class Daxiao{
public static void main(String[]args){
String strNumber1 = JOptionPane . showInputDialog (" ÇëÊäÈëµÚÒ»¸öÊý ") ;
String strNumber2 = JOptionPane . showInputDialog (" ÇëÊäÈëµÚ¶þ¸öÊý ") ;
int number1= Integer.parseInt (strNumber1 );
int number2= Integer.parseInt (strNumber2 );
if(number1>number2) {System.out.println("ÄúÊäÈëµÄÁ½¸öÊýÖÐ×î´óµÄÊýΪµÚÒ»¸öÊý£º"+number1);}
else if(number1==number2){System.out.println("ÄúÊäÈëµÄÁ½¸öÊýÏàµÈ£¬¶¼Îª£º"+number2);}
else {System.out.println("ÄúÊäÈëµÄÁ½¸öÊýÖÐ×î´óµÄÊýΪµÚ¶þ¸öÊý£º"+number2);}
}}
一楼的我按照你说的做后,发现无法建立application