我写了一个程序,用到了开源jar包。所用到的外包有:
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.labels.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.renderer.category.*;
import org.jfree.data.category.*;
这些包在如下几个.jar文件中
jxl.jar
jfreechart-1.0.10.jar
jcommon-1.0.13.jar
gnujaxp.jar
classes12.jar
现在想把我的JAVA程序打包成jar文件,要求可以双击就可以用。
前面看了http://topic.csdn.net/u/20070828/15/bcd5e2a4-9b02-4c60-b089-7c30cc106275.html?2052566247这个帖子,上面说自己建立MANIFEST.MF
我自己写的如下
Manifest-Version: 1.0
Created-By: 1.5.0_01 (Sun Microsystems Inc.)
Main-Class: yuebao.CallRecord
Class-Path: lib/jxl.jar lib/jfreechart-1.0.10.jar lib/jcommon-1.0.13.jar lib/gnujaxp.jar lib/classes12.jar使用 Eclipse 的 Export 功能,在按了三次“Next”(JAR Manifest Specification)后,选择 Use existing manifest from workspace,Browse 找到刚才新建的那个文件。按 Finish 结束。
我的jar文件在桌面上,所以我在桌面上建立了一个lib文件夹,把那些.jar文件放在里面。双击我打包好的jar文件。还是弹出could not find the main class. Program will exit. 请各位高手帮忙,这个包到底要怎么打才能让我双击可以运行。谢谢!!!!
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.labels.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.renderer.category.*;
import org.jfree.data.category.*;
这些包在如下几个.jar文件中
jxl.jar
jfreechart-1.0.10.jar
jcommon-1.0.13.jar
gnujaxp.jar
classes12.jar
现在想把我的JAVA程序打包成jar文件,要求可以双击就可以用。
前面看了http://topic.csdn.net/u/20070828/15/bcd5e2a4-9b02-4c60-b089-7c30cc106275.html?2052566247这个帖子,上面说自己建立MANIFEST.MF
我自己写的如下
Manifest-Version: 1.0
Created-By: 1.5.0_01 (Sun Microsystems Inc.)
Main-Class: yuebao.CallRecord
Class-Path: lib/jxl.jar lib/jfreechart-1.0.10.jar lib/jcommon-1.0.13.jar lib/gnujaxp.jar lib/classes12.jar使用 Eclipse 的 Export 功能,在按了三次“Next”(JAR Manifest Specification)后,选择 Use existing manifest from workspace,Browse 找到刚才新建的那个文件。按 Finish 结束。
我的jar文件在桌面上,所以我在桌面上建立了一个lib文件夹,把那些.jar文件放在里面。双击我打包好的jar文件。还是弹出could not find the main class. Program will exit. 请各位高手帮忙,这个包到底要怎么打才能让我双击可以运行。谢谢!!!!
java -jar *.jar;