简体   繁体   English

在64位Windows上编译的JAR不会在32位上运行

[英]JAR compiled on 64 bit Windows wont run on 32 bit

I have just developed and exported a Runnable JAR using Eclipse on my 64 Bit Windows 7 Laptop. 我刚刚在64位Windows 7笔记本电脑上使用Eclipse开发并导出了一个Runnable JAR。 I have just been trying it on other computers and it works on another Windows 7 x64 laptop when you double click it. 我刚刚在其他计算机上尝试过,当你双击它时,它可以在另一台Windows 7 x64笔记本电脑上运行。 However, on a 32 Bit laptop I have in only starts if I run it from command line using java -jar "C:\\Name of Jar.jar" but throws no errors whatsoever. 但是,在32位笔记本电脑上,如果我使用java -jar "C:\\Name of Jar.jar"从命令行运行它,我只能启动它,但不会抛出任何错误。

Furthermore though, if I use the command javaw "C:\\Name Of Jar.jar" I get an error message saying "Could not find the main class C:\\Name of Jar.jar. Program will exit." 此外,如果我使用命令javaw "C:\\Name Of Jar.jar"我收到一条错误消息“无法找到主要类C:\\ Jar.jar的名称。程序将退出。”

Does anybody know why, and how to fix it? 有人知道为什么,以及如何解决它? Thanks in advance 提前致谢

Did you build it with JDK 1.7? 你用JDK 1.7构建它了吗? Maybe you haven't installed JRE7 on the pc you try to run it. 也许您没有在尝试运行它的PC上安装JRE7。 It's an odd bug I encountered several times. 这是我遇到过几次奇怪的错误。

On your 32-bit machine right-click -> Open With on the JAR. 在32位计算机上右键单击 - >在JAR上打开。 If a JRE is listed, you can open with it, and make it the default program to run with. 如果列出了JRE,则可以使用它打开,并使其成为运行的默认程序。

I don't think it has to do with the 32 or 64-bit OS. 我不认为它与32位或64位操作系统有关。

Try javaw -jar jar_name . 试试javaw -jar jar_name I think that might do the trick. 我认为这可能会成功。

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

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