如何分发 AWTUtilities

发布于 2024-08-04 09:58:15 字数 224 浏览 5 评论 0原文

我最近阅读了关于 Pushing Pixels 的博客文章,其中描述了如何使用纯 Java 实现本机透明和半透明。所需的类位于 com.sun.awt 上,即 com.sun.awt.AWTUtilities。

我想知道如何将所需的类(不仅仅是这个)包含到我的发行版中,因为只有当您安装了 jdk 并通过那里启动 jvm 时,这些类才可用。因此我的程序的用户将没有运行我的程序所需的类。

有什么想法吗?

I recently read the blog posts on Pushing Pixels that describe how to achieve native transparency and translucency with pure Java. The needed classes reside on com.sun.awt namely com.sun.awt.AWTUtilities.

I was wondering how i could include the needed classes (not just this one) into my distro since the classes are available only when you have a jdk installed and you start the jvm through there. So the users of my program will not have the needed classes to run my program.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失而复得 2024-08-11 09:58:15

正如该包所暗示的那样,AWTUtilities 是一个实现包,并且可能会发生变化。我认为从技术和法律角度来分配课程并不是一个好主意。

从技术上讲,com.sun.awt.AWTUtlities 必然对其他类和内部实现细节具有可能未知的依赖关系,特定于 Java 6 u10 及更高版本 (它出现的版本)。这种未知的依赖关系一定会成立,因为绘画和图形也需要对某些本机实现进行更改。

其次,这在 Java 7 中肯定会发生变化,因为 Sun 唯一没有发布支持透明性的 java.awt.AWTUtilities 的版本,是因为除了主要版本之外,它们不会对公共 API 进行更改。

IANAL,但我认为在没有经过律师的情况下从事重新分发软件的行为是不明智的。此外,客户不喜欢在其系统中部署不受支持的任何软件。

更新

从 6u10 开始,所有 Sun JRE(不仅仅是 JDK)都附带 com.sun.awt.AWTUtilities,因此最简单的做法是让您的用户在其系统上安装 Java 6u10 或更高版本,并让您的应用程序能够优雅地处理任何产生的异常。

AWTUtilities, as the package implies is an implementation package and is subject to change. I don't think it is a good idea to distribute the class from both technical and legal viewpoints.

Technically, com.sun.awt.AWTUtlities is bound to have possibly unknown dependencies on other classes and internal implementation details, specific to Java 6 u10 and above (the release in which it appeared). This unknown dependency angle is bound to hold water, since painting and graphics will require changes in some of the native implementations as well.

Secondly, this is bound to change in Java 7, since the only release Sun hasn't made a release of java.awt.AWTUtilities with support for transparency, is because they do not make changes to public APIs except in major releases.

IANAL, but I do not think it is wise to engage in the act of redistributing software without having run past a lawyer. Besides, customers do not like the idea of having an unsupported deployment of any software in their systems.

Update

All Sun JREs (not just JDKs) from 6u10 onwards come with com.sun.awt.AWTUtilities, so the simplest course of action would be to get your users to have Java 6u10 or later on their systems, and for your application to handle any resulting exception gracefully.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文