问题描述
项目目前为每个支持的操作系统维护一个可分发项目。例如:
The SWT project currently maintains one distributable for each supported operating system. For example:
-
swt-3.4.2-win32-win32-x86.zip
-
swt-3.4.2-gtk-linux-x86.zip
-
swt-3.4.2-carbon-macosx.zip
swt-3.4.2-win32-win32-x86.zip
swt-3.4.2-gtk-linux-x86.zip
swt-3.4.2-carbon-macosx.zip
是否有可分发的那是正确的事情和交易;,无论应用程序运行在哪个操作系统上?
Is there a distributable that just Does the Right Thing™, regardless of which operating system the application is running on?
推荐答案
不,没有,你不能从独立的SWT发行版中制作一个。这是因为每个操作系统/窗口系统/体系结构组合都有自己的每个SWT类的实现。例如,如果您的代码引用org.eclipse.swt.widgets.Button,则JVM无法知道您是否需要该类的win32,Mac / Carbon或Mac / Cocoa实现。
No, there isn't, and you can't make one either out of the standalone SWT distributions. That's because each os/windowing system/architecture combination has its own implementation of each of the SWT classes. For example, if your code refers to org.eclipse.swt.widgets.Button, the JVM has no way of knowing if you want the win32, Mac/Carbon or Mac/Cocoa implementation of the class.
你可以想象通过编写一个能够找到平台,架构和窗口系统的加载器类来自己完成这个,然后加载正确的JAR。或者,使用equinox构建您的应用程序,它可以自动为您加载正确的SWT插件。但是你无法使用任何未经修改的SWT发行版。
You could conceivably do this yourself by writing a loader class that figured out the platform, architecture and windowing system and then loaded the right JAR. Or, architect your application using equinox, and it can load the right SWT plugin for you automatically. But you can't do it with any of the unmodified SWT distributions.
这篇关于SWT是否分发适用于任何支持的操作系统的JAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!