java java虚拟机启动器错误:无法访问jarfile

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14305253/
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-31 15:49:08  来源:igfitidea点击:

java virtual machine launcher error: unable to access jarfile

javajar

提问by ingie

I have downloaded a program to run on windows XP. According to the instructions, opening the .bat file that includes the command that calls the .jar file would be enough. Yet the program does not open. In a friend's computer the program does open.

我已经下载了一个可以在 Windows XP 上运行的程序。根据说明,打开包含调用 .jar 文件的命令的 .bat 文件就足够了。然而程序没有打开。在朋友的计算机中,该程序确实打开了。

I have set correctly the java-related environment variables. Java works fine. I have associated .jar files with java sdk.

我已经正确设置了java相关的环境变量。Java 工作正常。我已将 .jar 文件与 java sdk 相关联。

When calling the command javaw -Xms128M -Xmx512M -jar filename.jar from cmd I get a java virtual machine launcher error: unable to access jarfile

从 cmd 调用命令 javaw -Xms128M -Xmx512M -jar filename.jar 时,出现 java 虚拟机启动器错误:无法访问 jarfile

Then I called the same command while being on the folder where the jar is, I have no error, but still the gui of the program does not open.

然后我在jar所在的文件夹上调用了相同的命令,我没有错误,但程序的gui仍然没有打开。

Any ideas?

有任何想法吗?

On windows support the suggest unistalling and manually re-installing java, but java works fine in any other app.

在 Windows 上支持建议卸载和手动重新安装 java,但 java 在任何其他应用程序中都可以正常工作。

回答by George

Try some of the following:

尝试以下一些方法:

  1. Run directly from the .exe, so "C:...\jre\javaw.exe" -jar
  2. Try java -jar instead of javaw -jar.
  3. Try moving the file. It could be in a permissions sensitive directory.
  1. 直接从 .exe 运行,所以 "C:...\jre\javaw.exe" -jar
  2. 试试 java -jar 而不是 javaw -jar。
  3. 尝试移动文件。它可能位于权限敏感目录中。

Also, if the program was compiled using a 64-bit JDK, it might require a 64-bit JRE to run. In that case, you'd need to have a 64-bit OS/JRE to run it.

此外,如果程序是使用 64 位 JDK 编译的,则可能需要 64 位 JRE 才能运行。在这种情况下,您需要有 64 位 OS/JRE 才能运行它。