Eclipse中“文件”-“导出”菜单里面可以生成一个jar文件,但是我使用swt的时候需要用到一些Eclipse中的jar文件,本机运行可以使用classpath,但是如果到其他机器中还使用classpath的话总感觉不是很方便,所以特意来请教一下各位。

解决方案 »

  1.   

    我记得可以在jar的manifest.mf里写classpath,但是swt不只要jar,还要swt-*.dll在*nix中是swt-*.soLet's say you split the inter-dependent classes for a stock trade application, into three jar files: main.jar, buy.jar, and sell.jar. If you specify the Class-path attribute in the main.jar manifest as: 
    Class-Path: buy.jar sell.jar
    then you can use the i option to speed up your application's class loading time: 
    C:\Java> jar i main.jar
    An INDEX.LIST file is inserted to the META-INF directory which will enable the application class loader to download the specified jar files when it is searching for classes or resources.
      

  2.   

    万分感谢dyhml, 大家交个朋友吧 :)
    我的MSN: netver(at)hotmail.com