JNLP should use a specific Java version but error results

巧了我就是萌 提交于 2019-12-23 09:26:04

问题


I'm facing a problem here. I want to use a special version to run our java webstart application but just for one jnlp. ("It was tested, ... blabla we can't use a new version... blabla" by random windbag)

So I tried to configure our JNLP like this:

<resources>
    <j2se version="1.6.0_29" href="http://java.oracle.com/products/autodl/j2se"/>
    ...
</resources>

When I start this jnlp now I get following Error even if the right Java is installed:

Error: The application has requested a version of the JRE (version 1.6.0_29) that currently is not locally installed. Java Web Start is unable to automatically download and install the requested version. This JRE must be installed manually.

Update

In the JNLP File Syntax it's allowed to use a specific Java version like 1.6.0_29. I even tried it with 1.6.0_29-b11 - still the same error.

Exact product versions (implementation versions) may also be specified. by including the href attribute. For example, 1.3.1_07, 1.4.2, or 1.5.0-beta2 by Sun Microsystems, Inc. For example,

<j2se version="1.4.2" href="http://java.sun.com/products/autodl/j2se"/>

or

<j2se version="1.4.2_04" href="http://java.sun.com/products/autodl/j2se"/>

Edit

The given answer is not helping and not the right answer.


回答1:


This is quite common. Make sure that each client machine has enabled 1.6.0_29 for JNLP/Webstart.

Installing 1.6.0_29 is not necessarily enough to tell webstart that it's available. See this post for more information




回答2:


I had installed Java 1.6.0_21 and it was enabled at the Java Control Panel. However I got the same error message that it's stated in the question: "The application has requested a version of the JRE (version 1.6.0_29) that currently is not locally installed"

I got this message even if I tried with different lines in the JNLP, such as:

<j2se version="1.6.0_29"/>

or

<j2se version="1.6.0_29-b06"/>

I solved this by editing the JNLP file with the following line:

<j2se version="1.6"/>

So the documentation line "Exact product versions (implementation versions) may also be specified" seems to be false.




回答3:


Do you use :

jnlp spec="1.0+"

If so you should try with :

jnlp spec="6.0+"

I found this link, maybe there is something wrong in the configuration of your browser/JRE, or are you under a proxy?




回答4:


Troubleshoot:

  • Check the the version currently assigned to your project build path of your IDE
  • Make sure the version specified in j2se version="1.6.0_29" is installed on client machine.
  • Check your machine to see if you do not currently have any other versions currently installed which might cause dependency conflict.
  • Check your classpath setting to see the version currently set by default. Could this be the right version?

Also note that:

The j2se element specifies what Java 2 SE Runtime Environment (JRE) versions an application is supported on, as well as standard parameters to the Java Virtual Machine.

Therefore if you are looking to release the application to some specific versions, all the versions supported should be listed. Example:

   <j2se version="1.3" initial-heap-size="64m"/>
   <j2se version="1.4+"/>

In your case you've specifed the href attribute forcing Java Web Start not to consider an installed non-FCS (i.e., milestone) JRE as a match.

By convention a non-FCS (milestone) JRE if there is a dash (-) in the version string. And so would not consider an installed 1.4.1-ea or 1.4.2-beta JRE as a match for the request.

Edited.




回答5:


Auto-download of Software from java.sun.com

Try this url

j2se version="1.6.0_05+" href="http://java.sun.com/products/autodl/j2se"/>

if there are higher versions installed on the client machine the newest will used.

or

j2se version="1.6.0_05" href="http://java.sun.com/products/autodl/j2se"/>

then you will be prompt to install exactly 1.6.0_05.

when calling ?.jnlp versions 1.6.0_05 will be used.

be careful; above only works right when there's also i higher version installed then as example 1.6.0_29 runs 1.6.0_05 as a child.

In the Java Console you will see:

JavaPlug-in 1.6.0_31
Using JRE-Version 1.6.0_05 Java Hot Spot(TM) Client VM

If you really want to download a version not listed in the "The packages currently available for auto-download " then you can download the specified version 1.6.0_29 only if you have a greater version then 1.6.0_29 (maybe 1.6.0_31) as plugin enabled in the client browser. TEST install 1.6.0_31 and look if as Example: Firefox plugins 1.6.0_31 is there and enabled. Then the client will be able to automatic download and install 1.6.0_29 via *.jnlp.

Call your Application in a client browser. A warning appears : "Install a lower Version 1.6.0_29" and a "certificate warning" click yes. install 1.6.0_29 starts.

After Download the Browser restarts and the plugin 1.6.0_31 is gone!!! Therefore the Browser redirects to the Oracle download-side there you have to install the 1.6.0_31 again. Download starts to a folder you specified . Run the file "jxpinstall.exe" that starts the update; prompt to question install again ; yes (all browser must be closed) Install starts; Look at extras, plugins and there the 1.6.0_31 plugin is back again. Now you can use your *.jnlp application with 1.6.0_29. Really much work :-)

NOTE: You will not be able to install the browser plugin again with a file like "jdk-6u31-windows-i586.exe" You must follow the steps above. You will get a file "jxpinstall.exe" that is the right one.


The java.sun.com auto-download feature simplifies Java Web Start deployments because it makes commonly used software readily available for use with Java Web Start. Typically, only an extra line has to be added to a JNLP file to take advantage of this feature. ...

The packages currently available for auto-download are:

Java 2 Runtime Environment 1.3.0_02 for Windows/i586, Linux/i586, and Solaris/SPARC
.....
Java 2 Runtime Environment 1.4.2_16 for Windows/i586, Linux/i586, and Solaris/SPARC
Java Runtime Environment 1.5.0_02 for Windows/i586, Linux/i586, and Solaris/SPARC
.....    
Java Runtime Environment 1.5.0_14 for Windows/i586, Linux/i586, and Solaris/SPARC
Java Runtime Environment 1.6.0 for Windows/i586, Linux/i586, and Solaris/SPARC
Java Runtime Environment 1.6.0_04 for Windows/i586, Linux/i586, and Solaris/SPARC
Java Runtime Environment 1.6.0_05 for Windows/i586, Linux/i586, and Solaris/SPARC

available packages look here




回答6:


Its the damn java version, use of the lower versions fixes the issue. I used Java 1.8.0_05-b13 Java HotSpot(TM) 64-Bit Server VM and it went through successfully.



来源:https://stackoverflow.com/questions/10175453/jnlp-should-use-a-specific-java-version-but-error-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!