简体   繁体   English

加载Java VM时出现Windows错误2

[英]Windows error 2 occured while loading the Java VM

I've been trying to install this ARToolkit from Qualcomm: https://ar.qualcomm.at/qdevnet/ (Windows ".exe" version) on a Windows 7 64bits platform, and I keep getting the error: 我一直在尝试从Qualcomm安装这个ARToolkit: https ://ar.qualcomm.at/qdevnet/(Windows“.exe”版本)在Windows 7 64位平台上,我不断收到错误:

Windows error 2 occured while loading the Java VM 加载Java VM时出现Windows错误2

The program trying to install this program is InstallAnywhere, but I can't seem to find any documentation about this error. 尝试安装此程序的程序是InstallAnywhere,但我似乎无法找到有关此错误的任何文档。 The dialogue box name when the crash happens is LaunchAnywhere 发生崩溃时的对话框名称是LaunchAnywhere

I was just wondering if anyone had seen this kind of error before and if so, how to solve it. 我只是想知道是否有人曾经看过这种错误,如果是这样,如何解决它。 The very few answers I can find online relate to Win98/ME issues thus making them irrelevant. 我在网上找到的极少数答案与Win98 / ME问题有关,因此无关紧要。

I'm currently using JDK 1.7.0_04 and jre 1.7 if this is somehow relevant. 我目前正在使用JDK 1.7.0_04和jre 1.7,如果这在某种程度上是相关的。

Launch the installer with the following command line parameters: 使用以下命令行参数启动安装程序:

LAX_VM LAX_VM

For example: InstallXYZ.exe LAX_VM "C:\\Program Files (x86)\\Java\\jre6\\bin\\java.exe" 例如:InstallXYZ.exe LAX_VM“C:\\ Program Files(x86)\\ Java \\ jre6 \\ bin \\ java.exe”

在cmd中

C:\\Users\\Downloads>install.exe LAX_VM "C:\\Program Files\\Java\\jdk1.8.0_60\\bin\\java.exe"

For me it works a deleting "C:\\ProgramData\\Oracle\\Java\\javapath" in my system enviroment PATH variable 对我来说,它在我的系统环境PATH变量中删除“C:\\ ProgramData \\ Oracle \\ Java \\ javapath”

Edit: If you don't have that variable or it does not work you can directly delete or rename the directory "C:\\ProgramData\\Oracle\\Java\\javapath" 编辑:如果您没有该变量或它不起作用,您可以直接删除或重命名目录“C:\\ ProgramData \\ Oracle \\ Java \\ javapath”

'Windows error 2' has dozens of meanings (52 that I could find). “Windows错误2”有几十个含义(我可以找到52个)。

The most common one is ERROR_FILE_NOT_FOUND , which can be found in winerror.h . 最常见的是ERROR_FILE_NOT_FOUND ,可以在winerror.h找到。 Without more context, that's the best I can guess. 没有更多的背景,这是我能猜到的最好的。 Did you check the event logs to see if there's more information there? 您是否检查了事件日志以查看是否有更多信息?

Try adding C:\\path\\to\\java\\jre\\bin to your system environment variable PATH and run again. 尝试将C:\\path\\to\\java\\jre\\bin添加C:\\path\\to\\java\\jre\\bin到系统环境变量PATH并再次运行。 That worked for me! 这对我有用!

We could not uninstall a program, stuck with the "Windows error 2 cannot load Java VM". 我们无法卸载程序,坚持“Windows错误2无法加载Java VM”。 Added the Java path to the PATH variable, uninstalled and re-installed Java 8, the problem would not go away. 添加了Java路径到PATH变量,卸载并重新安装了Java 8,问题不会消失。

Then I found this solution online and it worked for us on the first shot: - Uninstall Java 8 - Install Java 6 然后我在网上找到了这个解决方案,它在第一次拍摄时对我们有用: - 卸载Java 8 - 安装Java 6

Whatever the reason, with Java 6, the error went away, we uninstalled the program, and re-installed Java 8. 无论是什么原因,使用Java 6,错误消失了,我们卸载了程序,并重新安装了Java 8。

If you get the error after installation: Find the .lax file with the matching exe name and update current vm path from: 如果安装后出现错误:找到带有匹配exe名称的.lax文件,并更新当前的vm路径:

lax.nl.current.vm=C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe lax.nl.current.vm = C:\\ ProgramData \\甲骨文\\爪哇\\ javapath \\的java.exe

to

lax.nl.current.vm=C:\\Program Files\\Java\\jre1.8.0_144\\bin\\java.exe lax.nl.current.vm = C:\\ Program Files \\ Java \\ jre1.8.0_144 \\ bin \\ java.exe

我认为它应该是.....\\javaw.exe" 。它对我.....\\javaw.exe" 。谢谢。

I had same mistake, it was produced because i had disabled the creation of "_jvm" in the InstallAnywhere ( project - JVM settings - Installer Settings - Bundled/Downloaded Virtual Machine ), then into file " Uninstall $PRODUCT_NAME$.lax " into uninstall folder, the variable " lax.nl.current.vm " is empty. 我犯了同样的错误,因为我在InstallAnywhere( 项目 - JVM设置 - 安装程序设置 - 捆绑/下载的虚拟机 )中禁用了创建“_jvm”,然后将文件“ 卸载$ PRODUCT_NAME $ .lax禁用到卸载中文件夹,变量“ lax.nl.current.vm ”为空。

If you don't need jvm is disabled check " Install Bundled / Downloaded Virtual Machine " option in the checkbox (project - JVM settings - Installer Settings - Bundled/Downloaded Virtual Machine). 如果您不需要禁用jvm,请选中复选框(项目 - JVM设置 - 安装程序设置 - 捆绑/下载的虚拟机)中的“ 安装捆绑/下载的虚拟机 ”选项。

If you need jvm is disabled because you create it manually, then you can do the following: create an action " Modify Text File " to append variable with the value of the _jvm folder. 如果您因为手动创建而需要禁用jvm,则可以执行以下操作:创建操作“ 修改文本文件 ”以使用_jvm文件夹的值附加变量。

(Existing File)
$USER_INSTALL_DIR$\Uninstall_$PRODUCT_NAME$ \Uninstall $PRODUCT_NAME$.lax

(Append)

lax.nl.current.vm=..\_jvm\bin\java.exe

I got the same problem after upgrading java from 1.8.0_202 to 1.8.0_211 将java从1.8.0_202升级到1.8.0_211后,我遇到了同样的问题

Problem: 问题:

Here are directories where new version of 1.8.0_211 of Java installed: 以下是安装Java的新版本1.8.0_211的目录:

Directory of c:\\Program Files\\Java\\jre1.8.0_211\\bin Directory of c:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath 目录c:\\ Program Files \\ Java \\ jre1.8.0_211 \\ bin目录c:\\ Program Files(x86)\\ Common Files \\ Oracle \\ Java \\ javapath

So one is located in 32 bit and second is in 64 bit Program files folder. 因此一个位于32位,第二个位于64位程序文件文件夹中。 The one that is specified in the PATH is 32 bit version (c:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath), even though it was 64 bit version of the Java that was installed. PATH中指定的版本是32位版本(c:\\ Program Files(x86)\\ Common Files \\ Oracle \\ Java \\ javapath),即使它是已安装的64位版本的Java。

Solution: 解:

Change system environments variable PATH from c:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath to c:\\Program Files\\Java\\jre1.8.0_211\\bin 将系统环境变量PATH从c:\\ Program Files(x86)\\ Common Files \\ Oracle \\ Java \\ javapath更改为c:\\ Program Files \\ Java \\ jre1.8.0_211 \\ bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM