0

I have write a small Java program using SWT GUI which search a given word inside a given text file, but when I run the program in Eclipse it works well, and if I exported it as a runnable jar file, in my PC it works well, but when I run it in other PC’s then it doesn’t work (cannot run, dosen't luanch the frame)… and also the same Java JDK (1.7) is installed in both my and other PC’s. Before JDK1.7 when I execute the runnable jar file it works well in all other PC’s, but now any jar file cannot run in other PC’s, but only in my PC…. Now if someone knows what the problem is, please suggest me how to solve.

Note: I exported the jar file in three options, but the result for all was the same.

  1. Extract required libraries into generated JAR
  2. Package required libraries into generated JAR
  3. Copy required libraries into a sub-folder next to generated JAR

Thanks in advance!

4

2 回答 2

2

转到构建路径 -> 配置构建路径 -> 订购和导出

并检查您的 jar 文件。

之后,尝试创建新的可运行 jar 文件。

于 2013-05-23T12:34:33.140 回答
0

我发现了“JAR 可运行文件无法在其他 PC 中执行”的问题,问题在于无法在 64 位 JVM 中执行的 SWT 库,我的机器是 32 位的。它抛出以下异常:

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
于 2013-05-24T16:20:19.943 回答