This page last changed on Aug 03, 2008 by scytacki.


This details how to make a Jnlp Servlet war which mirrors an existing set of jnlps and jars. The resulting war will contain the servlet and the jnlps and jars copied from another location. The mirroring process takes as input one or more jnlp urls. Those jnlps plus all of the jars and extension jnlps referenced by them are copied into the war.

If you want to build these jnlp and jars from source then you should follow the directions on this page: Setup JNLP Deployment Environment


  1. setup directories
  2. download and unzip a initial war file with jnlp-servlet jar and the web.xml
  3. download a java program JnlpServletCacher for installing a jnlp with its jars into the webapp
  4. run JnlpServletCacher with the urls to the jnlps and the directory where to save the resources
  5. create the war file


mkdir -p jnlp-servlet-work/jnlp-servlet; cd jnlp-servlet-work/jnlp-servlet                                
curl | jar x              
curl > ../jnlp2shell.jar    
for jnlp_url in $SERVLET_JNLPS 
  java -cp ../jnlp2shell.jar org.concord.JnlpServletCacher $jnlp_url .
jar cf ../jnlp-servlet.war .

This creates a dir called jnlp-servlet-work and creates inside it a deployable war file (and the expanded directory) and in the case above populates with the following jnlps and all of their associated resources:

If you are going to run this a lot then you probably want to

  • save this script as a file,
  • add the special shell script line on the top:
  • make it executable:
    chmod a+x [file_name]
  • make sure the list of jnlps is correct

empty-jnlp-servlet.war (application/octet-stream)
Document generated by Confluence on Jan 27, 2014 16:56