GianniTee
GianniTee

Reputation: 177

How to easily run desktop Java application via browser?

I made a Java desktop application that creates multiple interactive windows. I would like to show it to people not as a download link to a compressed folder archive, but as a program that runs as soon as they open my web site.

Enabling Java Web Start for this project in NetBeans programming environment, gave me launch.html page and launch.jnlp file that starts the application. It works except for a small detail. I need to include icons and additional files next to the JAR file in order to make it fully functional. These files should be perhaps downloaded locally when the web site is opened.

How can we achieve this?

Upvotes: 3

Views: 799

Answers (1)

Martin Pecka
Martin Pecka

Reputation: 3083

Open the JNLP file and add the required files as resources.

<resources>
    <jar href="OrigamistEditor.jar" main="true"/>
    <jar href="Origamist.jar"/>
    <jar href="another_required_files.jar"/>
</resources>

It would be ideal if you packed all your resource files into a single JAR file.

But I wonder why Netbeans wouldn't add these resources itself...

Upvotes: 3

Related Questions