About the signature of the WebStart project, release

xiaoxiao2021-03-06  13

Some friends have to consult me ​​about the release of the WebStart project, and do a finishing today. The following text is definitely original, and do not reprint the same. Suppose you have done your own SWING program. For example, the Swing program has been packaged into zhanglihai.ja assumes that your current system is a Win32 system, and the Java variable is configured, and WebStart is installed.

First, the signature program first puts the code COPY, build a file locally, such as: CreateKey.bat

KeyTool -Genkey-KeiStore mykeystore -alias myselfkeytool -selfcert -alias myself -keystore mykeystore keytore -list-readystore mykeystore

Then execute the CREATEKEY.BAT file. The following interface:

In accordance with the above prompt, remember your password you entered, the password in this example is 12345678.

After execution, the DOS window will automatically turn off, generate a file in the same directory with CreateKey: MyKeyStore

COPY Under the zhanglihai.jar directory, then Copy the following contents create a file such as: signjar.bat

Jarsigner -keystore mykeystore zhanglihai.jar myself

The preparation of the signature to this is completed.

Second, sign the JAR package

If your Swing project introduces other JAR packets, you should first put all the JARs of the referenced, and then make a directory according to the Java Package specification. Then connect zhanglihai.jar, strictly combine the above two Class files and directorys together according to Java's Package specification, and then re-package. I usually do this, open all JAR packets cited by the project, according to Java's Package, put it in a directory. Then use WinRAR to open Zhanglihai.rar and import the target file into the entry. Then save the exit. As shown below (I imported the JDOM package, "actually useless Class can not import in to reduce JAR's size):

If you sign ZHANGLIHI.rar and then import the JAR is equal to the signed sign, I have tried to use JB to put the needed JAR package and my own program into a JAR package, but the signature failed. Later, I used WinRAR's way.

Next, the new JAR package is signed, execute signjar.bat, enter the password, the password in this example is 12345678. As shown: The signature of this JAR is over.

Third, the deployment of the project

The WebStar project requires server-side support JNLP configuration, and the general servlet engine supports this type. If you don't support, you can add the following code in your web.xml;

class application / java jar Application / Java-Archive JNLP application / x-java-jnlp-file Then we build JNLP files such as: zhanglihai.jnlp as follows:

CNJBB Forum Desktop app " ortholic "in the master package"> -> then build an index.html file as follows: