3

I have a working webstart deployment of an application. This post says I can omit the codebase parameter. The documentation says the codebase parameter is optional.

When I omit the codebase parameter or use

codebase=""

my web start application fails to start because it is looking for the executable .jar file in the directory where the .jnlp file is downloaded to.

I would like to omit the codebase parameter because this particular webstart application will be deployed onto several different servers and I don't want to have to customize the .jnlp file for each server.

What is the correct story with the jnlp codebase parameter?

Community
  • 1
  • 1
Dean Schulze
  • 9,633
  • 24
  • 100
  • 165

2 Answers2

2

That post is incorrect. The only JNLP for which it is valid to leave out the document base, are those which are used to deploy an embedded applet. In that case, the code base will default to the same directory that contains the HTML.

Launch files for frames or free floating applets need a codebase.


codebase=""

By the way, that is an attribute with empty value, not an omitted attribute/value pair. For the embedded applet mentioned above, you would not include that at all.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
0

As of Java SE 7, from the specs here:

Beginning in the Java SE 7 release, you do not have to specify an absolute path for the codebase attribute in the Java Web Start application's Java Network Launch Protocol (JNLP) file. You can develop and test your applications in different environments without having to modify the path in the codebase attribute. If no codebase is specified, the Java Web Start software assumes that the codebase is relative to the web page from which the Java Web Start application is launched.

If no codebase is specified, the Java Web Start software assumes that the codebase is relative to the web page from which the Java Web Start application is launched.

jumping_monkey
  • 5,941
  • 2
  • 43
  • 58