Skip to main content

Distribute your Swing application via Java Web Start!

You have developed a nice desktop application and have been breaking your head to create an executable to distribute for different platforms! Here comes Java Web Start for your rescue, distribute your Swing application via web, no installers, no custom code for desktop shortcuts, no tweaks for auto-upgrades! Let me explain the process step by step.

Step 1: Jar your classes and resources using your favorite build tool.
Say your jar file is myswingapp.jar, rename it to myswingapp__V1.0.jar, ie, add '__V' and an initial version say 1.0. I will explain why this is needed in the coming section.
Step 2: Organize your dependencies as below:
root _folder>myswingapp__V1.0.jar
root _folder>jarfile1.jar
root _folder>jarfile2.jar
root _folder>jarfile3.jar
Step 3: Create a jnlp file as below and save it as myswingapp.jnlp

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="" 
        <description>A swing application</description>
        <icon href='logo48.png' kind='default'/>
        <icon kind="shortcut" href="icon.jpg" width="32" height="32"/>
        <shortcut online="false">
       <menu submenu="MySwingApp"/>
 <update check="background"/>
     <j2se version="1.6.0+"/>
        <jar href="myswingapp.jar" main="true" version="1.0"/>
        <jar href="jarfile1.jar"/>
        <jar href="jarfile2.jar "/>
        <jar href="jarfile3.jar "/>
        <property name="jnlp.versionEnabled" value="true"/>
    <application-desc main-class="com.myorg.Main"/>

Step 4: Copy all your jar files and the jnlp file to
Step 5: Create your download page say download.html and add the below script:

<script src=""></script>
<script type="text/javascript"> 
    var url = "";
    deployJava.createWebStartLaunchButton(url, '1.6.0');

Step 6: You are done! Now you can launch your application by accessing your download page, just click on the 'Launch' button, the installer will download your application and install it with a desktop shortcut as well as a menu item to launch the application. Great, isn't it?

Signing jars: If you want your application to run with full access, you must sign all your jar files.
Updates: An update check will be performed in the background and if an update is available, the application will download it and install it in the background! You just need to put your latest jar files, that's it!

Feel free to drop your comments. I will address your queries based on time availability!

Create Your Own Programming Language

A system to achieve every programmer’s dream. Learn how to create a simple programming language in a few days with this easy step-by-step guide.


  1. hi,
    I have the file myswingapp__V1.0 and myswingapp.jnlp as you gave as an example in my directory. But when I click it gives the error;
    unable to load resource: (file://localhost/C:/documents and settings/user/desktop/myswingapp.jar?version-id=1.0, 1.0)
    at Source)

    Also it gives a Wrapped Exception Error: file://localhost/C:/documents and settings/user/desktop/myswingapp.jar (System could not find the file)
    at Method)

    When I erase these parts from jnlp file and make my jar file as myswingapp.jar it works;
    update check="background"/

    property name="jnlp.versionEnabled" value="true"/


    version="1.0" part at jar href="myswingapp.jar" main="true" ...

    Can you help me with this problem?

  2. Hi Barbaros,

    You should follow the naming convention jarfile__V1.0.jar


  3. I mentioned wrong in the first post but I have already named my file as myswingapp__V1.0.jar and have those problems.

  4. Deploy your jnlp file in a web server, change your base url in jnlp accordingly.

    Also recommend you to upgrade to the latest version of Java as Java Web Start is not stable in any of the previous releases.

    Let me know whether it works or not.

  5. how the jnlp file will executed

    1. Command line: javaw
      Some browsers automatically opens jnlp file on clicking jnlp file link.


Post a Comment

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to our feed and get articles like this delivered automatically to your feed reader? Like our Facebook Page.


Induction Cooker Showing an Error Code? Induction Cooker Error Codes Explained

Are you searching for Induction Cook-top error codes? Here you can find the error codes of all popular induction cooktops and how to troubleshoot it.

These are for your reference only, do not try to open your cooktop without proper safety measures, we advise you to call the service person if any servicing is needed.

If you want to know how Induction Cook-top works, read our previous article titled What is Induction Cooker? How Induction Cooker Works?.

Whirlpool Induction Cooker Error CodesError CodeErrorSolutionF0An internal error was detected.Disconnect power. Wait 5 seconds before reconnecting power. If the symbol appears again, call for service.F2The surface cooking area is too hot and has turned off.Remove the pans from the surface cooking area. "F2" will disappear when the surface cooking area has cooled. If you turn the surface cooking area back on and "F2" reappears, the cooktop is still too hot. Turn off the surface cooking area and allow it to cool.F4The po…

HDFC Bank introduces Missed Call Service to know Account Balance

Missed call is a powerful business tool in developing countries like India where customers give a miss call to specific phone numbers for getting account details, providing feedback, voting etc. On receiving a missed call from a registered phone number, the underlying app performs a phone number lookup and sends the data to the caller via text message(SMS) or records the call details for future processing.HDFC Bank recently introduced missed call service for its retail customers which allows to retrieve bank account details, mini statement etc. by simply giving a miss call to their toll free numbers.Following services are now available: 1800 270 3333 - Account Balance 1800 270 3355 - Mini Statement 1800 270 3366 - Request for new Cheque Book 1800 270 3377 - Request for Bank account statement Also you can download HDFC Mobile Banking Application by giving a missed call to : 1800 270 3344. Other banks providing missed call serviceAxis bank(known as Axis Dial) - 09225892258Bank of India…

Top Travel Websites Reviewed - Makemytrip, Yatra, ClearTrip, Ezeego1 and TravelGuru

Disclaimer: This is an independent review on some of the most popular travel websites, I am not associated with any of these travel websites nor their promoters. If you do not agree with any of the comparisons made here, post your concerns as a comment so that the same will be reviewed and the content under question will removed from this blog.

Websites Reviewed:MakeMyTrip - - - - - Engine Visibility :: :: Book Google shows the following as group results: Domestic Airlines - International Flights - Indigo Airlines - Air India, which is a guge plus! Same here, Domestic Flights - Trains - International Flights - Hotels are shown as group Keyword rich title but not user friendly - Hotels India Disco…