Java运行jar

如何在JDK1.3.1可执行的JAR文件?

说明创建一个可执行的。jar文件




制作或修改的MANIFEST.MF到YourManifest.MF。

1)YourClassNameWithMain是类名(区分大小写)未经验证。class扩展名
2)随着YourClassName withMain没有多余的空格。

清单的版本:1.0
主类:YourClassNameWithMain
建立由:1.2(Sun微系统公司)
在命令行:键入以下
罐子CVFM公司YourJarFileName.jar YourManifest.MF *



罐子CVFM公司YourJarFileName.jar YourManifest.MF - C类yourClassPath
拖放到桌面的YourJarFileName.jar双击它,它运行
如果你的程序只有System.out.println(“无所谓”);报表时,将
显示任何内容。 同样会发生在你运行它使用AT命令行渣华

你需要一些Windows代码,看看它运行

说明创建一个。jar文件。 JAR实用程序来与您的JDK1.2.2它压缩您的文件类似zip工具,以及更多的Java。

你可以使用任何机器上安装JDK

创建一个文件夹命名为任何东西
使该文件夹的当前目录
把在打开的所有文件(不要提出任何额外的)在该目录中。

务必把您的HTML文件,如果有一
在您的DOS提示符下,当你在创建的目录中键入:
罐子的CVF Prj02.jar *

这将需要包括子目录中的所有目录中的文件并将其放置在一个。jar文件Prj02可由您想要的任何JAR文件名替换他们。

为了测试它,你可以提取罐中键入文件的内容:
罐子xvf命令Prj02.jar




How to make executable jar files in JDK1.3.1?

Instructions for creating an Executable .jar file




Make or modify the Manifest.MF to YourManifest.MF.

1) YourClassNameWithMain is the class name (case sensitive) without .class extension
2) No extra spaces following the YourClassName withMain.

Manifest-Version:1.0
Main-Class: YourClassNameWithMain
Created-by:1.2(Sun Microsystems Inc.)
On Command line : type the following
jar cvfm YourJarFileName.jar YourManifest.MF*

or

jar cvfm YourJarFileName.jar YourManifest.MF -C classes yourClassPath
Drag-drop the YourJarFileName.jar to your desktop double click it, it runs
If your program only has System.out.println ("whatever"); statements, it will
display nothing. The same will happen when you run it useing java at command line

You need some windows code to see it run

Instructions for creating a .jar file. jar utility comes with your JDK1.2.2 It compresses your file similar to zip utility, and more Java.

You can use it on any machine installed JDK

Create a folder name it anything
Make that folder your current directory
put all your files for turning in (do not put any extra) in that directory.

Be sure to put your html file, if there is one
At your dos prompt, while you are in the directory that you created , type in:
jar cvf Prj02.jar*

This will take ALL the files in the directory including subdirectories and place them in a .jar

file Prj02 that can be replaced by any of your desired jar file name.

To test it, you can extract the contents of jar file by typing:
jar xvf Prj02.jar





相关文档
最新文档