3

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?

1 Answer 1

3

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...

Sign up to request clarification or add additional context in comments.

4 Comments

"It would be ideal if you packed all your resource files into a single JAR file." For any of many reasons too long to expound in a comment, no it wouldn't.
Maybe I'm missing something? That's the way I do it all the time - the image and text resources go into the main JAR file and other required JARs are referenced in the resources. I can imagine if your resources are either large or change often, it may be wise to put them into a separate JAR file. But what are the other reasons?
By 'resource files' I read 'resources & classes', but even then, it makes more sense to separate them. "But what are the other reasons?" Like I said, 'too many reasons'. Why not ask your own question based on that?
For example, I have an RTF document that serves as a log. One of the windows is RTF editor, so this file is saved regularly. I don't know why :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.