---
title: "java web start"
author: "sanshi"
date: "2007-06-10T20:17:22Z"
tags: []
slug: "java-web-start"
draft: false
lastmod: "2007-06-10T20:17:22Z"
id: 88955
url: "https://sanshi.iteye.com/blog/88955"
---

web start  如果路径设置不好，就会出现各种错误，下面给出一个完整的步骤，首先新建一个web project  服务器：tomcat，它支持application/x-java-jnlp-file,所以在Jnlp里就不用设置了，新建一个类要有main()，然后打包，jar cvf  Hello.jar  \*.class,

在写一个Hello.jnpl文件，如下：

(?xml version="1.0" encoding="UTF-8"?)

(jnlp codebase="http://202.193.86.47:8080/zzzzz/" href="http://202.193.86.47:8080/zzzzz/Hello.jnlp")  
(information)  
(title)Hello(/title)

        (vendor)Lively Corporation(/vendor)

        (description)HelloWorld Test Example for WebStart.(/description)  
       (homepage href="http://localhost:8080/zzzzz/index.html"/)  
        (icon href="http://202.193.86.47:8080/zzzzz/images/13.gif"/)  
        (icon kind="splash" href="http://202.193.86.47:8080/zzzzz/images/13.gif"/)  
        (offline-allowed/)

    (/information)  
  (security)  
    (all-permissions/)  
  (/security)    (resources)

        (j2se version="1.5+"/)  
        (jar href="http://202.193.86.47:8080/zzzzz/Hello.jar"/)  
         (/resources)  
         
       (application-desc main-class="Hello"/)

(/jnlp)        
       

 

按照提示输入后，键入y ,接着给Hello.jar签名，jarsigner -keystore  mykeystore  Hello.jar  mykey 

       &lt;homepage href="http://localhost:8080/zzzzz/index.html"&gt;&lt;/homepage&gt;  
        把Hello.jar和Hello.jnpl放到项目目录下，下面就是签名了。在命令行里： keytool  -genkey -alias mykey -keystore mykestore    [参考](http://java.sun.com/products/javawebstart/demos.html)