JNLP File Association: How do I open the file which was double-clicked on?

Posted by Sam Barnum on Stack Overflow See other posts from Stack Overflow or by Sam Barnum
Published on 2010-05-21T00:54:08Z Indexed on 2010/05/21 1:00 UTC
Read the original article Hit count: 342

Filed under:
|
|

I've got the following JNLP:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0.10//EN" "http://java.sun.com/dtd/JNLP-6.0.10.dtd">
<jnlp spec="6.0.10" version="1.63" codebase="http://foo.example.com/msi" href="Foo.jnlp">
    <information>
        <title>Foo</title>
        <vendor> Foo Systems, Inc.</vendor>
        <homepage href="http://Foo.com"/>
        <description>Foo Viewer/Editor Application</description>
        <icon href="splash.gif" width="425" height="102" kind="splash"/>
        <icon href="Foo.gif" width="64" height="64"/>
        <offline-allowed/>
        <shortcut>
            <desktop/>
            <menu submenu="Foo Systems, Inc."/>
        </shortcut>
        <association mime-type="application-x/wlog" extensions="wlog"/>
        <association mime-type="application-x/mplot" extensions="mplot"/>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.6+" initial-heap-size="32m" max-heap-size="255m"/>
        <jar href="jars_deployment/TimingFramework-1.0.jar"/>
        <jar href="jars_deployment/iText-2.1.5.jar"/>
        <jar href="jars_deployment/jai_codec.jar"/>
        <jar href="Foo.jar"/>
        <jar href="jars_deployment/TimingFramework-1.0.jar"/>
        <jar href="jars_deployment/iText-2.1.5.jar"/>
        <jar href="jars_deployment/jai_codec.jar"/>
        <jar href="jars_deployment/jsch-20090402.jar"/>
        <property name="apple.laf.useScreenMenuBar" value="true"/>
        <property name="apple.awt.graphics.UseQuartz" value="false"/>
        <property name="com.apple.mrj.application.apple.menu.about.name" value="Foo"/>
        <property name="java.util.logging.config.file" value="/Users/Shared/logging.properties"/>
    </resources>
    <application-desc main-class="com.prosc.msi.editor.ui.test.Sandbox"/>
</jnlp>

Most everything is working. When I double-click a .wlog file, it opens up my application. However, it doesn't open the correct file. I read somewhere that JNLP was supposed to pass parameters to the main method indicating which file caused the app to be launched, but this is not happening (on OS X 10.6). I get an empty array to my application's main method.

Probably unrelated, my splash screen doesn't work :(

Any pointers on getting this working?

© Stack Overflow or respective owner

Related posts about jnlp

Related posts about java