Local alternative to JNLP file?

Try as I could, I can’t run the JNLP file to run locally (with a double click). It seems that the problem is finding the jar file, even when I point it relative to the jnlp file. I get the following error:

The <jar> href field has an invalid Value: helloworld.jar

This happens even when the JNLP file is in the same folder as helloworld.jar. I did a search and this is not an easy problem, especially for people who want to pack the application on a CD and use JNLP. The only "solution" provided by Sun is the ability to specify a codebase through the command line, but that doesn't help much. I do not understand why they do not assume or do not allow the code base to be "." or "file: //." - I tried such things in the codebase parameter of the jnlp tag (inside the file), and nothing worked.




It’s very convenient for me to use the JNLP file because I don’t have to worry about discovering the platform, my own libraries or even the main JARL JARL files; I just include this line and everything is done for me:

<extension name="JOGL" href="http://download.java.net/media/jogl/builds/archive/jsr-231-2.0-beta10/webstart/jogl-all-awt.jnlp" /> 

I hope to find one that can do the same. If not, I can manually (or using Ant) capture jogl jar files, this is not very important; just one of the things that JNLP does for me, and I really will be bored.




What is the best alternative to JNLP files for me to use locally (i.e. double click to run)? Is there something so elegant or do I just need to write a shell script for Linux, a batch file for Windows and Ant to detect and load the corresponding JOGL banks?

+8
java jnlp jogl
Jan 09 2018-10-10 at
source share
6 answers

I used a .jnlp file like this to run local Java Web Start software

  • specify the code base as follows: <jnlp spec="1.0+" codebase="file://localhost/X:/path/to/jnlp/" href="software.jnlp">

  • list of resources with relative paths: <resources> <jar href="lib/software.jar" main="true" /> <jar href="lib/softwareLibrary.jar" main="true" /> ... </resources>

  • and finally tell the website where it can find the software entry point to the bank marked main="true" : <application-desc main-class="com.example.Main" />

The only thing you need to change during remote deployment is the codebase parameter.

+19
Mar 10 '10 at 13:00
source share

Just remove the codebase and href attributes from the jnlp tag.

 <jnlp spec="1.0+"> 

This is supported with java 1.6u18.

+4
Jun 21 '12 at 6:01
source share

The JNLP system has been improved with the Java 6 10 update (some time ago), but it is quite difficult to debug (enabling full tracing in the Java console and navigating through javaws source code.

In your situation, I would go the extra mile and make it work. Perhaps you would provide a complete JNLP file showing the problem?

+2
Jan 09 '10 at 9:55
source share

Use the manifest for your jar. There you can define the main class to run and the necessary libraries. See Main-class and Class-path arguments in the manifest specification.

+1
Jan 09 '10 at 6:25
source share

According to dhiller, adding a manifest to the JAR allows users to work with a physical copy without access to the network. Also, instead of providing a .jnlp pointing to a local JAR, include the .jnlp that links to your site. This will allow users to run the latest and best version of your program and easily set a shortcut for inquiries in the future.

0
Jan 09 '10 at 9:36
source share

JNLP is designed to run the network (specifically http (s)), and without a network, the Java implementation should really get confused. Even mature projects like eclipse have the option .sh, .bat.

0
Jan 20
source share



All Articles