Skip to main content

Problem with JNLP file generation

Please note these forums are being decommissioned and use the new and improved forums at
3 replies [Last post]
Joined: 2008-01-25

I have an application client compiled under Java 7. When I run it from GlassFish, the JNLP file specifies Java version "1.6+", which causes Java 6 to be loaded to run the client. This naturally fails because of the class file version, so I wanted to override the JNLP and specify the proper Java version.

(Disabling JRE 6 in the Java Control Panel applet didn't work as it just got re-enabled by the Java environment. I don't know why that checkbox is even there.)

After much wailing and gnashing of teeth, I was able to find enough on the web to create the following JNLP fragment:

<?xml version="1.0" encoding="UTF-8"?>
        <java version="1.7+" java-vm-args=""/>

I then created glassfish-application-client.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Commented out due to bug in definition of jnlp-doc element. -->
<!--DOCTYPE glassfish-application-client PUBLIC "-// GlassFish Application Server 3.1 Java EE Application Client 6.0//EN" ""-->

However, the generated JNLP file didn't replace the "java" tag; it duplicated it:

<!--        <java version="1.6+"
             java-vm-args="-showversion -javaagent=http://admin.gateway:8080/___JWSappclient/___system/s1as/glassfish/lib/gf-client.jar=mode=jws,${agent.args} " /> -->
        <java java-vm-args="" version="1.7+"/><java java-vm-args="" version="1.6+"/>

This is clearly a bug and I can't find any way around it.

Does anyone know how to change the default version of Java that the GlassFish server writes to JNLP files?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-03-30

I am working with Kevin off-line on a possible solution for him.

- Tim

Joined: 2009-12-18

I have the exact same problem with gf 3.1.2 and, netbeans 7.4. Did you ever find a solution?


Joined: 2008-01-25

Tim provided me with a solution but I'll leave it to him to decide whether or not to post it publicly. If you would like me to send it to you directly, please contact me at kevin . dean at datadevelopment . com (minus the spaces of course).