Use Java web start to start application on the command line by thefile name

Discussion in 'Java' started by albert kao, Feb 2, 2011.

  1. albert kao

    albert kao Guest

    I can use Java web start to start my Swing GUI application on the
    command line by the url:
    javaws http://localhost:7001/webstart/myapp/launch.jnlp

    How to use Java web start to start my Swing GUI application on the
    command line by the file name?
    The following ways do not work:
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket launch.jnlp
    javaws -J-Xdebug -J-Xnoagent -J-
    Xrunjdwp:transport=dt_socket,server=n,suspend=y launch.jnlp
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=n,suspend=n
    launch.jnlp
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n
    launch.jnlp
    javaws -codebase "" launch.jnlp
    javaws -codebase '' launch.jnlp

    The launch.jnlp file is as follows:
    <?xml version="1.0" encoding="utf-8"?>

    <jnlp spec="1.0+" codebase="$$codebase" href="$$name">

    <information>
    <title>${com.prod.my.myapp.common.client.title}</title>
    <vendor>I</vendor>
    <homepage href="http://devzone/english/dev%20template/
    html_templates/main.asp"/>
    <description>${com.prod.my.myapp.common.client.description}</
    description>
    <description kind="short">$
    {com.prod.my.myapp.common.client.short_description}</description>
    <icon href="$$context/images/chflag.jpg"/>
    </information>

    <security>
    <all-permissions/>
    </security>

    <resources>

    <java version="1.6.0_05" href="http://java.sun.com/products/autodl/
    j2se" max-heap-size="256m"/>

    <!-- myapp Application -->
    <jar href="myprod.myapp.client.jar"/>
    <jar href="myprod.reports.jar"/>

    <!-- TR Client jar -->
    <jar href="extern.ejb-client.jar"/>

    <property name="java.naming.factory.initial"
    value="weblogic.jndi.WLInitialContextFactory"/>
    <property name="java.naming.provider.url" value="$
    {com.prod.my.myapp.common.client.naming_provider}"/>
    <property name="weblogic.jndi.enableServerAffinity"
    value="true" /

    </resources>

    <application-desc main-
    class="com.prod.my.myapp.common.framework.applicationmainwindow.gui.myappAp­
    plication"/

    </jnlp>
     
    albert kao, Feb 2, 2011
    #1
    1. Advertising

  2. albert kao

    Arne Vajhøj Guest

    Re: Use Java web start to start application on the command line bythe file name

    On 02-02-2011 10:34, albert kao wrote:
    > I can use Java web start to start my Swing GUI application on the
    > command line by the url:
    > javaws http://localhost:7001/webstart/myapp/launch.jnlp
    >
    > How to use Java web start to start my Swing GUI application on the
    > command line by the file name?
    > The following ways do not work:
    > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket launch.jnlp
    > javaws -J-Xdebug -J-Xnoagent -J-
    > Xrunjdwp:transport=dt_socket,server=n,suspend=y launch.jnlp
    > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=n,suspend=n
    > launch.jnlp
    > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n
    > launch.jnlp
    > javaws -codebase "" launch.jnlp
    > javaws -codebase '' launch.jnlp


    Try one of:

    file://launch.jnlp
    file:///C:/somedir/launch.jnlp

    Arne
     
    Arne Vajhøj, Feb 2, 2011
    #2
    1. Advertising

  3. albert kao

    albert kao Guest

    Re: Use Java web start to start application on the command line bythe file name

    On Feb 2, 12:38 pm, Arne Vajhøj <> wrote:
    > On 02-02-2011 10:34, albert kao wrote:
    >
    >
    >
    >
    >
    > > I can use Java web start to start my Swing GUI application on the
    > > command line by the url:
    > > javawshttp://localhost:7001/webstart/myapp/launch.jnlp

    >
    > > How to use Java web start to start my Swing GUI application on the
    > > command line by the file name?
    > > The following ways do not work:
    > > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket launch.jnlp
    > > javaws -J-Xdebug -J-Xnoagent -J-
    > > Xrunjdwp:transport=dt_socket,server=n,suspend=y launch.jnlp
    > > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=n,suspend=n
    > > launch.jnlp
    > > javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n
    > > launch.jnlp
    > > javaws -codebase ""  launch.jnlp
    > > javaws -codebase ''  launch.jnlp

    >
    > Try one of:
    >
    > file://launch.jnlp
    > file:///C:/somedir/launch.jnlp
    >
    > Arne- Hide quoted text -
    >
    > - Show quoted text -


    Both
    file://launch.jnlp
    file:///C:/somedir/launch.jnlp
    will result in the error:
    com.sun.deploy.net.FailedDownloadException: Unable to load resource:

    javaws -codebase "" launch.jnlp
    java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at com.sun.javaws.Main.parseArgs(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    #The following has no error message, but nothing appear on the
    computer screen:
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket launch.jnlp
    javaws -J-Xdebug -J-Xnoagent -J-
    Xrunjdwp:transport=dt_socket,server=n,suspend=y launch.jnlp
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=n,suspend=n
    launch.jnlp
    javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n
    launch.jnlp
     
    albert kao, Feb 2, 2011
    #3
  4. albert kao

    Arne Vajhøj Guest

    Re: Use Java web start to start application on the command line bythe file name

    On 02-02-2011 16:09, albert kao wrote:
    > On Feb 2, 12:38 pm, Arne Vajhøj<> wrote:
    >> On 02-02-2011 10:34, albert kao wrote:
    >>
    >>
    >>
    >>
    >>
    >>> I can use Java web start to start my Swing GUI application on the
    >>> command line by the url:
    >>> javawshttp://localhost:7001/webstart/myapp/launch.jnlp

    >>
    >>> How to use Java web start to start my Swing GUI application on the
    >>> command line by the file name?
    >>> The following ways do not work:
    >>> javaws -codebase "" -J-Xrunjdwp:transport=dt_socket launch.jnlp
    >>> javaws -J-Xdebug -J-Xnoagent -J-
    >>> Xrunjdwp:transport=dt_socket,server=n,suspend=y launch.jnlp
    >>> javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=n,suspend=n
    >>> launch.jnlp
    >>> javaws -codebase "" -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n
    >>> launch.jnlp
    >>> javaws -codebase "" launch.jnlp
    >>> javaws -codebase '' launch.jnlp

    >>
    >> Try one of:
    >>
    >> file://launch.jnlp
    >> file:///C:/somedir/launch.jnlp

    >
    > Both
    > file://launch.jnlp
    > file:///C:/somedir/launch.jnlp
    > will result in the error:
    > com.sun.deploy.net.FailedDownloadException: Unable to load resource:
    >
    > javaws -codebase "" launch.jnlp
    > java.net.MalformedURLException: unknown protocol: c
    > at java.net.URL.<init>(Unknown Source)
    > at java.net.URL.<init>(Unknown Source)
    > at java.net.URL.<init>(Unknown Source)
    > at com.sun.javaws.Main.parseArgs(Unknown Source)
    > at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    > at com.sun.javaws.Main$1.run(Unknown Source)
    > at java.lang.Thread.run(Unknown Source)


    That lines was not one I suggested.

    And where does the c come from for the first of them?

    Arne
     
    Arne Vajhøj, Feb 2, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Persson
    Replies:
    7
    Views:
    623
    Jan Persson
    Feb 23, 2004
  2. Replies:
    8
    Views:
    1,449
    Flash Gordon
    Oct 4, 2008
  3. Carolina
    Replies:
    0
    Views:
    941
    Carolina
    Jan 27, 2010
  4. Alex. O. Koranteng

    Cannot start service from command line error for WCF application

    Alex. O. Koranteng, Aug 26, 2009, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    1,755
    Steven Cheng
    Aug 27, 2009
  5. Ting Wang
    Replies:
    3
    Views:
    203
    Paul Lalli
    Dec 13, 2005
Loading...

Share This Page