用eclipse运行java源程序后生成错误信息提示:could not find the main class program will exit
来源:百度知道 编辑:UC知道 时间:2024/06/16 20:05:16
我所运行的这个程序是没有问题的,因为用JCreartor运行过,该程序是这样的:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GoodLucky extends JFrame implements ActionListener{
JTextField tf = new JTextField();
JButton b1 = new JButton("��ʼ��");
JButton b2 = new JButton("����");
boolean isGo = false;
public GoodLucky(){
b1.setActionCommand("start");
JPanel p = new JPanel();
p.add(b1);
p.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
b2.setEnabled(false);
this.getContentPane().add(tf,"North");
this.getContentPane().add(p,"South");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(300,200);
this.setLocation(300,300);
Cursor cu = new Cursor(Cursor.HAND_CURSOR);
this.setCurs
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GoodLucky extends JFrame implements ActionListener{
JTextField tf = new JTextField();
JButton b1 = new JButton("��ʼ��");
JButton b2 = new JButton("����");
boolean isGo = false;
public GoodLucky(){
b1.setActionCommand("start");
JPanel p = new JPanel();
p.add(b1);
p.add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
b2.setEnabled(false);
this.getContentPane().add(tf,"North");
this.getContentPane().add(p,"South");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(300,200);
this.setLocation(300,300);
Cursor cu = new Cursor(Cursor.HAND_CURSOR);
this.setCurs
知道了..你在eclipse里面还没有保存吧....右键你的工程,properties--->Info--->Text file encoding下面的other选UTF-8..-->Apply-->ok
因为你在JCreartor是以UTF-8保存的..运行就OK了..
运行是:右键你的那个类-->run as
有可能是jdk配置的问题,你看看你的JDK配置正确没的
.java的文件怎么用eclipse运行啊?
请问JAVA eclipse需要如何设置才能运行java程序
怎么用eclipse运行jsp?
eclipse中怎样运行带命令行参数的java程序
怎样用eclipse 打包java成可直接运行的程序
eclipse里.java可以编译但不能运行??
在eclipse里编写的JAVA程序怎么脱离eclipse运行(直接打开)?
刚开始JAVA,用ECLIPSE是否合适?
用eclipse编译JAVA,没有找到main
用eclipse运行java源程序后生成错误信息提示:could not find the main class program will exit