user591790
user591790

Reputation: 555

Browser showing content of jnlp file

I made small sample example in jws that is running on local machine. I have tested in mozilla browser. But when I put this example on server then and trying to access .jnlp file then it is showing only content of .jnlp file. I have looked every where on internet they are saying that .jnlp file must be associate with java web start. File types already associate in my machine. So please help me how to overcome of this problem.

This is my HelloWorld.jnlp file:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://67.227.202.160/~koder/demo" href="HelloWorld.jnlp">
    <information>
        <title>Hello World Demo</title>
        <vendor>Dynamic Team</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.6+"
              href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="HelloWorld.jar" main="true"/>

    </resources>
    <application-desc
         name="Hello World Demo"
         main-class="HelloWorld.HelloWorld">
     </application-desc>
     <update check="background"/>
</jnlp>

Upvotes: 0

Views: 2600

Answers (3)

Sujan Reddy A
Sujan Reddy A

Reputation: 132

If you just run the applet code inside html tags it doesn't work. Run them inside script(javascript) tags.

get the jars and class out of jnlp file and put them into applet code. then make that applet runs as java script from your html code.

Upvotes: 0

pmoleri
pmoleri

Reputation: 4451

You have to configure the mime type on your server: http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/setup.html

That way when your server serves the file it tells the browser that it's a jnlp file.

Upvotes: 3

Zolt&#225;n
Zolt&#225;n

Reputation: 22156

You have to set your applications associations in Firefox. Go to the Firefox button (the one in the topleft corner), options -> options, applications tab and set the .jnlp extension to the sun java web start launcher.

Upvotes: 0

Related Questions