我无法使用“Java Web Start”启动 JNLP 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1912676/
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
I am not able launch JNLP applications using "Java Web Start"?
提问by akjain
Up until recently, I was able to launch/open JNLPfiles in Firefoxusing Java web start.
直到最近,我才能够使用Java web start在Firefox 中启动/打开JNLP文件。
Don't know what happened all of a sudden JNLPfiles stopped launching, a splash screen appears saying Java Starting...and then nothing happens. Even the Java Consolein the browser and javacpl.cplapplet doesn't open.
不知道发生了什么突然JNLP文件停止启动,出现一个闪屏,说Java 正在启动...然后什么也没发生。甚至浏览器中的Java 控制台和javacpl.cpl小程序也打不开。
Tried all possibilities: removed all older version and installed the latest JRE (java version "1.6.0_17"), still it doesn't work.
尝试了所有可能性:删除了所有旧版本并安装了最新的 JRE(java 版本“1.6.0_17”),但仍然无法正常工作。
Done some googling for this problem, people suggested to start javaws.exewith -vieweroption but same behavior (a splash screen appears saying "Java Starting..." and then disappears)
为这个问题做了一些谷歌搜索,人们建议使用-viewer选项启动javaws.exe,但行为相同(闪屏显示“Java 正在启动...”然后消失)
The problem is that I don't know any place (logs etc.) to look for to see what is causing the problem.
问题是我不知道要查找任何地方(日志等)以查看导致问题的原因。
I am using WinXP SP3, and some of the screenshots below shows further info about my system. I can provide any other detail if required but please help me solve this problem.
我使用的是 WinXP SP3,下面的一些屏幕截图显示了有关我的系统的更多信息。如果需要,我可以提供任何其他详细信息,但请帮助我解决此问题。
采纳答案by akjain
Although this question is bit old, the issue was caused by corrupted ClearType registry settingand resolved by fixing it, as described in this ClearType, install4j and case of Java bugpost.
虽然这个问题有点老,但问题是由损坏的 ClearType 注册表设置引起的,并通过修复它来解决,如本ClearType、install4j 和 Java 错误帖子中所述。
ClearType, install4j and case of Java bug Java
Do you know what ClearType (font-smoothing technology in Windows) has in common with Java (programming language and one of the recommended frameworks)?
Nothing except that they were working together hard at making me miserable for few months. I had some Java software that I couldn't install. I mean really couldn't – not even figure out reason or reproduce it on another PC.
Recently I was approved for Woopra beta (site analytics service) and it uses desktop client written in Java… I couldn't install. That got me really mad. :)
Story All of the software in question was similar :
setup based on install4j; setup crashing with bunch of errors. I was blaming install4j during early (hundred or so) attempts to solve issue. Later I slowly understood that if it was that bugged for that long time – solution would have been created and googled.
Tracing After shifting focus from install4j I decided to push Java framework. I was trying stable versions earlier so decided to go for non-stable 1.6 Update 10 Release Candidate.
This actually fixed error messages but not crashes. I had also noticed that there was new error log created in directory with setup files. Previously I had only seen logs in Windows temporary directory.
New error log was saying following :
Could not display the GUI. This application needs access to an X Server. If you have access there is probably an X library missing. ******************************************************************* You can also run this application in console mode without access to an X server by passing the argument -c Very weird to look for X-Server on non-Linux PC, isn't it? So I decided to try that “-c” argument. And was actually able to install in console mode.
Happy ending? Nope. Now installed app was crashing. But it really got me thinking. If console works but graphical interface doesn't – there must be problem with latter.
One more error log (in application folder) was now saying (among other things) :
Caused by: java.lang.IllegalArgumentException: -60397977 incompatible with Text-specific LCD contrast key Which successfully googled me description of bug with Java unable to read non-standard ClearType registry setting.
Solution I immediately launched ClearType Tuner from Control Panel and found setting showing gibberish number. After correcting it to proper one all problems with Java were instantly gone.
cleartypetuner_screenshot Lessons learned Don't be fast to blame software problems on single application. Even minor and totally unrelated settings can launch deadly chain reactions. Links Jave Runtime Environment http://www.java.com/en/download/index.jsp
ClearType Tuner http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
Woopra http://www.woopra.com/
install4j http://www.ej-technologies.com/products/install4j/overview.html
ClearType、install4j 和 Java bug Java 案例
您知道 ClearType(Windows 中的字体平滑技术)与 Java(编程语言和推荐框架之一)有什么共同之处吗?
除了他们一起努力让我痛苦了几个月之外,别无他法。我有一些无法安装的 Java 软件。我的意思是真的不能 - 甚至无法找出原因或在另一台 PC 上重现它。
最近我获得了 Woopra beta(站点分析服务)的批准,它使用用 Java 编写的桌面客户端……我无法安装。这让我真的很生气。:)
故事 所有有问题的软件都是相似的:
基于 install4j 的设置;设置因一堆错误而崩溃。我在早期(大约数百次)尝试解决问题时指责 install4j。后来我慢慢明白,如果它被窃听了那么长时间——解决方案就会被创建和谷歌搜索。
跟踪 从 install4j 转移焦点后,我决定推动 Java 框架。我之前尝试过稳定版本,因此决定使用非稳定版 1.6 Update 10 Release Candidate。
这实际上修复了错误消息,但不会崩溃。我还注意到在包含安装文件的目录中创建了新的错误日志。以前我只在 Windows 临时目录中看到过日志。
新的错误日志如下:
无法显示 GUI。此应用程序需要访问 X 服务器。如果您有权访问,则可能缺少 X 库。****************************************************** ***************** 您还可以通过传递参数 -c 在控制台模式下运行此应用程序,而无需访问 X 服务器,在非 Linux 上查找 X 服务器非常奇怪电脑,不是吗?所以我决定尝试使用“-c”参数。并且实际上能够在控制台模式下安装。
美好结局?不。现在安装的应用程序崩溃了。但这确实让我思考。如果控制台工作但图形界面不工作——后者肯定有问题。
另一个错误日志(在应用程序文件夹中)现在说(除其他外):
引起:java.lang.IllegalArgumentException:-60397977 与文本特定的 LCD 对比度键不兼容它成功地用谷歌搜索了我关于 Java 无法读取非标准 ClearType 注册表设置的错误描述。
解决方案我立即从控制面板启动了 ClearType Tuner,发现设置显示乱码。在将其纠正为正确的一个之后,Java 的所有问题都立即消失了。
cleartypetuner_screenshot 经验教训 不要急于将软件问题归咎于单个应用程序。即使是次要且完全不相关的设置也可能引发致命的连锁反应。链接 Java 运行时环境http://www.java.com/en/download/index.jsp
ClearType 调谐器 http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
install4j http://www.ej-technologies.com/products/install4j/overview.html
回答by Thorbj?rn Ravn Andersen
Have a look at what happens if you run javaws.exe directly from the command line.
看看如果直接从命令行运行 javaws.exe 会发生什么。
回答by spork
Is this an application to which you have the code? Java 6u14 included a change to the way it handles jar security that for us caused very similar issues. If your jars are signed and work with Java 6u13 or below, you might consider either refactoring your code to work around this update or requiring Java 6u13 or below. Unfortunately I don't recall exactly what we did to resolve the issue - it was panic mode at the time.
这是您拥有代码的应用程序吗?Java 6u14 对它处理 jar 安全性的方式进行了更改,这对我们来说导致了非常相似的问题。如果您的 jar 已签名并使用 Java 6u13 或更低版本,您可以考虑重构代码以解决此更新或要求 Java 6u13 或更低版本。不幸的是,我不记得我们到底做了什么来解决这个问题——当时是恐慌模式。
Again, if you have the code you have tools to work with. You can put in System.out.println
statements in your startup routines - anything console output is displayed in the command window when you run the JNLP from the command line. Otherwise you might consider using a nice logger like log4j
to get a better idea of the point of failure.
同样,如果你有代码,你就有工具可以使用。您可以在System.out.println
启动例程中放入语句 - 当您从命令行运行 JNLP 时,任何控制台输出都会显示在命令窗口中。否则,您可能会考虑使用一个不错的记录器log4j
来更好地了解故障点。
You may also consider removing the application entirely and downloading it anew. Java Web Start has a Control Panel applet that allows you to see the URL your app is downloading from (could be the wrong one), uninstall the app, set security options, etc.
您也可以考虑完全删除该应用程序并重新下载。Java Web Start 有一个控制面板小程序,可让您查看应用程序下载的 URL(可能是错误的)、卸载应用程序、设置安全选项等。
回答by Bob Lauer
If javacpl does not open and gives you Could not find the main class:, it could be that Java is confused because of changes in deployment.properties (can be found in C:\Users\<username>\AppData\LocalLow\Sun\Java\Deployment on Win7
). Delete that file and everything's fine.
如果javacpl不开,让您找不到主类:,这可能是因为Java的是因为在deployment.properties(可以发现变化的混淆C:\Users\<username>\AppData\LocalLow\Sun\Java\Deployment on Win7
)。删除该文件,一切正常。
This bug seems to be 6 years old, cf. An app should be able to ignore properties that have become obsolete over time, shouldn't it?
这个错误似乎是 6 岁,参见。应用程序应该能够忽略随着时间的推移已经过时的属性,不是吗?
回答by nairb
i had the same problem here. go to your Java Control Panel and Settings... Uncheck 'Keep temporary files on my computer'. Apply changes and try again your .jnlp
我在这里遇到了同样的问题。转到您的 Java 控制面板和设置...取消选中“在我的计算机上保留临时文件”。应用更改并重试您的 .jnlp
Note: Tested on different machines; Windows Server 2012, Windows Server 2008 and Windows 7 64bit. Java Version: 1.7++ since my jnlp app is built on 1.7
注:在不同机器上测试;Windows Server 2012、Windows Server 2008 和 Windows 7 64 位。Java 版本:1.7++,因为我的 jnlp 应用程序是基于 1.7 构建的
Please let me know your feedback too. :D
也请让我知道您的反馈。:D
回答by hpereira
I know this is an older question but this past week I started to get a similar problem, so I leave here some notes regarding the solution that fits me.
我知道这是一个较旧的问题,但上周我开始遇到类似的问题,所以我在这里留下了一些关于适合我的解决方案的注释。
This happened only in some Windows machines using even the last JRE to date (1.8.0_45).
这只发生在一些 Windows 机器上,甚至使用迄今为止的最后一个 JRE (1.8.0_45)。
The Java Web Start started to load but nothing happened and none of the previous solution attempts worked.
Java Web Start 开始加载,但什么也没发生,之前的解决方案尝试都没有奏效。
After some digging i've found this thread, which gives the same setup and a great explanation.
经过一番挖掘,我找到了这个线程,它提供了相同的设置和很好的解释。
https://community.oracle.com/thread/3676876
https://community.oracle.com/thread/3676876
So, in conclusion, it was a memory problem in x86 JRE and since our JNLP's max heap was defined as 1024MB, we changed to 780MB as suggested and it was fixed.
因此,总而言之,这是 x86 JRE 中的内存问题,并且由于我们的 JNLP 的最大堆定义为 1024MB,我们按照建议更改为 780MB 并已修复。
However, if you need more than 780MB, can always try launching in a x64 JRE version.
但是,如果您需要超过 780MB,可以随时尝试以 x64 JRE 版本启动。
回答by Bech
I had the exact same problem. Turned out that the max-heap-size was set to 1024 and missing the unit. The configuration needed to be max-heap-size=1024m.
我有同样的问题。结果发现 max-heap-size 设置为 1024 并且缺少该单位。配置需要为 max-heap-size=1024 m。
So apparently invalid memory configuration in the jnlp file will cause this exact behavior.
所以 jnlp 文件中显然无效的内存配置将导致这种确切的行为。
回答by Rick
In my case, the problem was caused by starting my app from a shortcut on the public desktop (windows 7). As a result, as far as I can tell, the temporary files location was set to c:\users\public\etc. This resulted in the unable to write to cache detail. When I reset to defaults in the temporary files control applet, all worked fine.
就我而言,问题是由从公共桌面(Windows 7)上的快捷方式启动我的应用程序引起的。结果,据我所知,临时文件位置设置为 c:\users\public\etc。这导致无法写入缓存详细信息。当我在临时文件控制小程序中重置为默认值时,一切正常。
回答by ryvantage
In my case, Netbeans automatically creates a .jnlp file that doesn't work and my problem was due to an accidental overwriting of the launch.jnlp
file on the server (by the inadequate and incorrect version from Netbeans). This caused a mismatch between the local .jnlp
file and the remote .jnlp
file, resulting in Java Web Start just quitting after "Verifying application."
就我而言,Netbeans 会自动创建一个不起作用的 .jnlp 文件,我的问题是由于意外覆盖launch.jnlp
了服务器上的文件(由于 Netbeans 的版本不足且不正确)。这导致本地.jnlp
文件和远程.jnlp
文件不匹配,导致 Java Web Start 在“验证应用程序”后直接退出。
So no one else has to waste an hour finding a bug that should be communicated adequately (but isn't) by Java WS.
因此,任何人都不必浪费一个小时来查找应该由 Java WS 充分沟通(但不是)的错误。
回答by Marc.S
This can also be due to environment variable CATALINA_HOME in your system. In our organization there were several cases where JNLP applications just refused to start without logging anything and emptying CATALINA_HOME solved the issue.
这也可能是由于系统中的环境变量 CATALINA_HOME。在我们的组织中,有几种情况下 JNLP 应用程序只是拒绝启动而不记录任何内容并清空 CATALINA_HOME 解决了该问题。
I had the environment variable set in the command prompt and it didn't appear in GUI. I'm not sure if setx command or register removal commands did the trick. Restart seems to be necessary after removing the variable.
我在命令提示符中设置了环境变量,但它没有出现在 GUI 中。我不确定 setx 命令或注册删除命令是否有效。删除变量后似乎需要重新启动。