将java程序打包之后,双击生成的jar文件,老是出现错误提示,用eclipse打包的
双击之后老是出现:could not find the main class. Program will exit.
其它程序打包都没有问题,就单单这一个出现问题,我不知道是为什么,麻烦各位高手指点,我也手工打包过,还是不行,程序如下:
package yuebao;
import java.io.*;
import java.text.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class CallRecord
{
public static void main(String[] args)
{
int b=0;
POIFSFileSystem pfs=null;
HSSFWorkbook hwb=null;
try
{
pfs=new POIFSFileSystem(new FileInputStream( "CallRecord(Running).xls "));
hwb=new HSSFWorkbook(pfs);
HSSFSheet sheet=hwb.getSheetAt(0);
int rowNum;
int i;
String[] date=new String[3100];
double[] record=new double[3100];
double[] percent=new double[3100];
rowNum = sheet.getLastRowNum();
//System.out.println(rowNum);
for (i = 4; i <= rowNum; i++) {
//System.out.println(sheet.getRow(i).getCell((short)0).getDateCellValue().toLocaleString());
date[i]=sheet.getRow(i).getCell((short)0).getDateCellValue().toLocaleString();
HSSFCell cl=sheet.getRow(i).getCell((short)1);
record[i]=Double.parseDouble(cl.toString().trim());
HSSFCell c2=sheet.getRow(i).getCell((short)2);
percent[i]=Double.parseDouble(c2.toString().trim());
//System.out.println(i+ "--- "+date[i]+ "--- "+record[i]+ "--- "+percent[i]);
}
HSSFWorkbook wb=new HSSFWorkbook();
FileOutputStream fo=new FileOutputStream( "callRecord.xls ");
HSSFSheet ht=wb.createSheet( "彩铃月报 ");
HSSFRow r1 = ht.createRow((short)0);
HSSFCell c1 = r1.createCell((short)0);
c1=r1.getCell((short)0);
c1.setCellValue( "日期1 ");
HSSFCell c2 = r1.createCell((short)1);
c2=r1.getCell((short)1);
c2.setCellValue( "日期2 ");
HSSFCell c3 = r1.createCell((short)2);
c3=r1.getCell((short)2);
c3.setCellValue( "忙时试呼次数 ");
HSSFCell c4 = r1.createCell((short)3);
c4=r1.getCell((short)3);
c4.setCellValue( "忙时应答率 ");
double[] result1=new double[93];
int start=4;
int end=96;
int n=0;
for(int j=start;j <=end;j++)
{