JNLP 应该使用特定的 Java 版本但错误结果

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10175453/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 23:55:48  来源:igfitidea点击:

JNLP should use a specific Java version but error results

javajnlpjava-web-start

提问by alexvetter

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)

我在这里面临一个问题。我想使用一个特殊版本来运行我们的 java webstart 应用程序,但仅用于一个 jnlp。(“它已经过测试,...... blabla 我们不能使用新版本...... blabla” by random windbag)

So I tried to configure our JNLP like this:

所以我尝试像这样配置我们的 JNLP:

<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:

当我现在启动这个 jnlp 时,即使安装了正确的 Java,我也会收到以下错误:

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.

错误:应用程序请求了当前未在本地安装的 JRE 版本(版本 1.6.0_29)。Java Web Start 无法自动下载和安装请求的版本。必须手动安装此 JRE。

Update

更新

In the JNLP File Syntaxit'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.

JNLP 文件语法中,允许使用特定的 Java 版本,如1.6.0_29。我什至用1.6.0_29-b11尝试过- 仍然是同样的错误。

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"/>

也可以指定确切的产品版本(实施版本)。通过包含 href 属性。例如,Sun Microsystems, Inc 的 1.3.1_07、1.4.2 或 1.5.0-beta2。例如,

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

或者

<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.

给出的答案没有帮助,也不是正确的答案。

回答by Sergei Vasalin

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

这是很常见的。确保每台客户端机器都为 JNLP/Webstart 启用了 1.6.0_29。

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

安装 1.6.0_29 不一定足以告诉 webstart 它可用。请参阅此帖子以获取更多信息

Webstart settings

Webstart settings

回答by Alzhaid

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"

我已经安装了 Java 1.6.0_21 并且在 Java 控制面板中启用了它。但是,我收到了与问题中所述相同的错误消息:“应用程序请求了当前未在本地安装的 JRE 版本(版本 1.6.0_29)”

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

即使我尝试在 JNLP 中使用不同的行,我也会收到此消息,例如:

<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:

我通过使用以下行编辑 JNLP 文件解决了这个问题:

<j2se version="1.6"/>

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

所以文档行“也可以指定确切的产品版本(实现版本)”似乎是错误的。

回答by Ramki

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.

它是该死的 java 版本,使用较低版本可以解决问题。我使用了 Java 1.8.0_05-b13 Java HotSpot(TM) 64-Bit Server VM,并且成功通过了。

回答by moskito-x

Auto-download of Software from java.sun.com

从 java.sun.com 自动下载软件

Try this url

试试这个网址

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

j2se 版本="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"/>

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.

然后你会被提示安装 1.6.0_05。

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

调用 ?.jnlp 版本 1.6.0_05 时将使用。

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.

当心; 以上仅在安装了 i 更高版本时才有效,然后作为示例 1.6.0_29 运行 1.6.0_05 作为孩子。

In the Java Console you will see:

在 Java 控制台中,您将看到:

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_29only if you have a greater version then 1.6.0_29(maybe 1.6.0_31) as plugin enabledin 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.

如果您确实想下载未在“当前可用于自动下载的软件包”中列出的版本,那么您可以下载指定的 1.6.0_29 版本,前提是您的版本高于 1.6.0_29(可能是 1.6.0_31)作为在客户端浏览器中启用插件。测试安装 1.6.0_31 并查看是否为示例:Firefox 插件 1.6.0_31 存在并启用。然后客户端就可以通过*.jnlp自动下载安装1.6.0_29。

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.

在客户端浏览器中调用您的应用程序。出现警告:“安装较低版本 1.6.0_29”和“证书警告”,单击“是”。安装 1.6.0_29 开始。

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 :-)

下载后浏览器重启,插件 1.6.0_31 不见了!!!因此浏览器重定向到 Oracle 下载端,您必须再次安装 1.6.0_31。下载开始到您指定的文件夹。运行启动更新的文件“jxpinstall.exe”;提示再次提问安装;是(必须关闭所有浏览器)安装开始;看看附加功能,插件,然后 1.6.0_31 插件又回来了。现在您可以在 1.6.0_29 中使用您的 *.jnlp 应用程序。真的很多工作:-)

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.

注意:您将无法使用“jdk-6u31-windows-i586.exe”之类的文件再次安装浏览器插件,您必须按照上述步骤操作。您将获得一个正确的文件“jxpinstall.exe”。



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. ...

java.sun.com 自动下载功能简化了 Java Web Start 部署,因为它使常用软件易于与 Java Web Start 一起使用。通常,只需向 JNLP 文件添加额外的行即可利用此功能。...

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

可用的包看这里

回答by Bitmap

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?
  • 检查当前分配给您的 IDE 项目构建路径的版本
  • 确保j2se version="1.6.0_29"在客户端计算机上安装了 中指定的版本。
  • 检查您的机器,看看您当前是否没有安装任何可能导致依赖冲突的其他版本。
  • 检查您的类路径设置以查看当前默认设置的版本。这可能是正确的版本吗?

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.

j2se 元素指定支持应用程序的 Java 2 SE 运行时环境 (JRE) 版本,以及 Java 虚拟机的标准参数。

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 hrefattribute forcing Java Web Start not to consider an installed non-FCS (i.e., milestone) JRE as a match.

在您的情况下,您指定了href强制 Java Web Start 不将已安装的非 FCS(即里程碑)JRE 作为匹配项的属性。

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.

按照惯例,如果版本字符串中有破折号 (-),则为非 FCS(里程碑)JRE。因此不会将已安装的 1.4.1-ea 或 1.4.2-beta JRE 视为与请求的匹配项。

Edited.

已编辑。

回答by alain.janinm

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?

我找到了这个链接,也许你的浏览器/JRE 的配置有问题,或者你是否在代理下?