0

Sometimes there are serious regression bugs in Java which make our product unusable. So I would like to disallow the associated version, e.g. currently 8u161 and 8u162 (bug JDK-8195830).

How can I do so in JNLP? The docs only mention + as a wildcard. So is the only possible way to list all other Java versions instead? like

<java version="1.8.0_05"/>
<java version="1.8.0_11"/>

... until ...

<java version="1.8.0_151"/>
<java version="1.8.0_152"/>

?

Update: So the result looks like this.

<java version="1.8.0_172+ 1.8.0_152 1.8.0_151 1.8.0_144 1.8.0_141 1.8.0_131 1.8.0_121 1.8.0_112 1.8.0_111 1.8.0_102 1.8.0_101 1.8.0_92 1.8.0_91 1.8.0_74 1.8.0_73 1.8.0_72 1.8.0_71 1.8.0_66 1.8.0_65 1.8.0_60 1.8.0_51 1.8.0_45 1.8.0_40 1.8.0_31 1.8.0_25 1.8.0_20 1.8.0_11 1.8.0_05"/>

Conclusion: In the end I decided not to provide any version constraints in the JNLP, because the popup says it recommends to start the application anyway – which is quite the opposite of what I have to tell the user.

Marcus
  • 1,857
  • 4
  • 22
  • 44

1 Answers1

1

The problems seems to be that *racle seems to have dropped support for loading and using earlier JREs except for the most up to date JRE. Your approach seems to be the only pure JNLP-way as also suggested here.

You may also try to write it in one big line separated by spaces. The only thing which I would change is the order so that the highest is a the top.

"If several JREs are specified, this indicates a prioritized list of the supported JREs, with the most preferred version first."

You may want to theck similar quesions posted here

A different approach to exclude a specific java version is to check it within your application.

public static void main(String [] args) {
  String version = System.getProperty("java.version");
  if("1.8.0_161".equals(version) || "1.8.0_162".equals(version){
    //print an error dialog
  }
  else{
   //continue normal flow
  }
}

In a previous application I even went a bit further and had two different web applications: A "light" web application which was started before the actual application. This light web app nearly had no requirements regarding java version (even started with 1.4) and it would then check all the necessary requirements (Java Version, OS, RAM, CPU, files ...). Only after all went well the actual application would be started.

Lonzak
  • 9,334
  • 5
  • 57
  • 88