java-trap.html - en to zh_CN translation catalogue (32 entries)

note: type: Content of: <title>
en: Free but Shackled - The Java Trap - GNU Project - Free Software Foundation
zh_CN: 戴镣铐的自由 - Java 陷阱 - GNU 工程 - 自由软件基金会

note: type: Content of: <div><h2>
en: Free but Shackled - The Java Trap
zh_CN: 戴镣铐的自由 - Java 陷阱

note: type: Content of: <div><address>
en: by <a href="https://www.stallman.org/">Richard Stallman</a>
zh_CN: <a href="https://www.stallman.org/">理查德·斯托曼</a> 著

note: type: Content of: <div><div><h3>
en: Headnote
zh_CN: 前言

note: type: Content of: <div><div><p>
en: Since this article was first published, Sun (now part of Oracle)  has <a href="https://www.fsf.org/news/fsf-welcomes-gpl-java.html">relicensed</a> most of its Java platform reference implementation under the GNU General Public License, and there is now a free development environment for Java.  Thus, the Java language as such is no longer a trap.
zh_CN: 自这篇文章首次发布以来，Sun（现在是 Oracle 的一部分）已经根据 GNU 通用公共许可证<a href="https://www.fsf.org/news/fsf-welcomes-gpl-java.html">重新授权了</a>其大部分 Java 平台参考实现，且现在有一个自由的 Java 开发环境。因此，Java 语言本身不再是陷阱。

note: type: Content of: <div><div><p>
en: You must be careful, however, because not every Java platform is free.  Sun continues distributing an executable Java platform which is nonfree, and other companies do so too.
zh_CN: 但是，您必须小心，因为并非每个 Java 平台都是自由的。Sun 继续分发非自由的可执行 Java 平台，其他公司也这样做。

note: type: Content of: <div><div><p>
en: The free environment for Java is called IcedTea; the source code Sun freed is included in that.  So that is the one you should use.  Many GNU/Linux distributions come with IcedTea, but some include nonfree Java platforms. (Note, added 10/2015: The free implementation of Java is known as OpenJDK in many GNU/Linux distributions.)
zh_CN: Java 的自由环境称为IcedTea。Sun 释放的源代码被包含在其中。因此，它是您应该使用的。许多 GNU/Linux 发行版包含了 IceTea，但其中一些发行版包括非自由的 Java 平台。（请注意，于 2015 年 10 月添加：Java 的自由实现在许多 GNU/Linux 发行版中被称为 OpenJDK。）

note: type: Content of: <div><div><p>
en: To reliably ensure your Java programs run fine in a free environment, you need to develop them using IcedTea.  Theoretically the Java platforms should be compatible, but they are not compatible 100 percent.
zh_CN: 为了可靠地确保 Java 程序在自由的环境中正常运行，您需要使用 IcedTea 开发它们。理论上，Java 平台应该兼容，但它们并不是 100％ 兼容。

note: type: Content of: <div><div><p>
en: In addition, there are nonfree programs with &ldquo;Java&rdquo; in their name, such as JavaFX, and there are nonfree Java packages you might find tempting but need to reject.  So check the licenses of whatever packages you plan to use.  If you use Swing, make sure to use the free version, which comes with IcedTea. (Note, added 10/2015: A free replacement for JavaFX called OpenJFX has been released.)
zh_CN: 此外，还有一些名称上带有 &ldquo;Java&rdquo; 的非自由程序，例如 JavaFX，并且还有一些非自由 Java 程序包，您可能会很感兴趣，但是需要拒绝它们。所以，请检查您想使用的任何软件包的许可证。 如果使用 Swing，请确保使用和 IcedTea 一起发布的自由版本。（注意，在 2015 年 10 月添加：JavaFX 的自由替代叫做 OpenJFX，已经发布。）

note: type: Content of: <div><div><p>
en: Aside from those Java specifics, the general issue described here remains important, because any nonfree library or programming platform can cause a similar problem.  We must learn a lesson from the history of Java, so we can avoid other traps in the future.
zh_CN: 除了这些 Java 规范外，此处描述的一般问题仍然很重要，因为任何非自由库或编程平台都可能导致类似问题。我们必须从 Java 的历史中吸取教训，以便将来避免其他陷阱。

note: type: Content of: <div><div><p>
en: Please also see: <a href="/philosophy/javascript-trap.html"> The JavaScript Trap</a>.
zh_CN: 另请参见：<a href="/philosophy/javascript-trap.html"> JavaScript 陷阱</a>。

note: type: Content of: <div><p>
en: <em>April 12, 2004</em>
zh_CN: <em>2004 年 4 月 12 日</em>

note: type: Content of: <div><p>
en: If your program is free software, it is basically ethical&mdash;but there is a trap you must be on guard for. Your program, though in itself free, may be restricted by nonfree software that it depends on. Since the problem is most prominent today for Java programs, we call it the Java Trap.
zh_CN: 如果你的程序是自由软件，这基本上是道德的&mdash;&mdash;但有一个陷阱，您必须警惕。您的程序虽然本身是自由的，但可能受其依赖的非自由软件的限制。由于问题对于 Java 程序而言今天最为突出，因此我们将其称为 Java 陷阱。

note: type: Content of: <div><p>
en: A program is free software if its users have certain crucial freedoms. Roughly speaking, they are: the freedom to run the program, the freedom to study and change the source, the freedom to redistribute the source and binaries, and the freedom to publish improved versions. (See the <a href="/philosophy/free-sw.html">Free Software Definition</a>.)  Whether any given program in source form is free software depends solely on the meaning of its license.
zh_CN: 如果程序的用户拥有一些关键的自由，则该程序为自由软件。粗略地说，它们是：运行程序的自由，学习和更改源代码的自由，重新分发源代码和二进制文件的自由以及发布改进版本的自由。（请参阅 <a href="/philosophy/free-sw.html">自由软件定义</a>。）一个有源代码的程序是不是自由软件，只依赖于其许可证的含义。

note: type: Content of: <div><p>
en: Whether the program can be used in the Free World, used by people who mean to live in freedom, is a more complex question. This is not determined by the program's own license alone, because no program works in isolation. Every program depends on other programs. For instance, a program needs to be compiled or interpreted, so it depends on a compiler or interpreter. If compiled into byte code, it depends on a byte-code interpreter. Moreover, it needs libraries in order to run, and it may also invoke other separate programs that run in other processes. All of these programs are dependencies.  Dependencies may be necessary for the program to run at all, or they may be necessary only for certain features. Either way, all or part of the program cannot operate without the dependencies.
zh_CN: 程序是否可以在自由世界中使用，供那些想生活在自由中的人们使用，这是一个更复杂的问题。这不是仅由程序本身的许可证确定的，因为没有程序可以独立运行。每个程序都依赖于其他程序。例如，程序需要编译或解释，因此它取决于编译器或解释器。如果编译为字节码，则取决于字节码解释器。而且，它需要库才能运行，并且它还可以调用在其他进程中运行的其他单独程序。所有这些程序都是依赖项。依赖关系可能是程序运行必需的，或者可能仅对于某些功能是必需的。无论哪种方式，如果没有依赖，程序或其部分功能将无法实现。

note: type: Content of: <div><p>
en: If some of a program's dependencies are nonfree, this means that all or part of the program is unable to run in an entirely free system&mdash;it is unusable in the Free World. Sure, we could redistribute the program and have copies on our machines, but that's not much good if it won't run. That program is free software, but it is effectively shackled by its nonfree dependencies.
zh_CN: 如果某个程序的某些依赖项是非自由的，则意味着该程序的全部或部分无法在完全自由的系统中运行&mdash;&mdash;在自由世界中无法使用。当然，我们可以重新分发该程序，并在我们的计算机上保留副本，但是如果它无法运行，那就不好了。程序是自由软件，但是由于其非自由依赖关系而受到束缚。

note: type: Content of: <div><p>
en: This problem can occur in any kind of software, in any language. For instance, a free program that only runs on Microsoft Windows is clearly useless in the Free World. But software that runs on GNU/Linux can also be useless if it depends on other nonfree software. In the past, Motif (before we had LessTif) and Qt (before its developers made it free software) were major causes of this problem. Most 3D video cards work fully only with nonfree drivers, which also cause this problem. But the major source of this problem today is Java, because people who write free software often feel Java is sexy. Blinded by their attraction to the language, they overlook the issue of dependencies and fall into the Java Trap.
zh_CN: 在任何类型的软件，任何语言中都可能出现这种问题。例如，仅在 Microsoft Windows 上运行的自由程序在自由世界中显然毫无用处。但是，如果它依赖于其他非自由软件，则在 GNU/Linux 上运行的软件也可能无用。过去，Motif（在我们拥有 LessTif 之前）和 Qt（在其开发人员使它成为自由软件之前）是造成此问题的主要原因。 大多数3D视频卡只能与非自由驱动程序一起完整使用，这也会导致此问题。但是今天这个问题的主要根源是 Java，因为编写自由软件的人经常会觉得 Java 很性感。由于对语言的吸引力而被蒙蔽，他们忽略了依赖的问题，落入了 Java 陷阱。

note: type: Content of: <div><p>
en: Sun's implementation of Java is nonfree. The standard Java libraries are nonfree also. We do have free implementations of Java, such as the <a href="https://objectcomputing.com/resources/publications/sett/january-2003-gcj-the-gnu-compiler-for-java"> GNU Compiler for Java</a> (GCJ) and <a href="/software/classpath">GNU Classpath</a>, but they don't support all the features yet. We are still catching up.
zh_CN: Sun 的 Java 实现不是自由的。标准 Java 库也是非自由的。我们确实有 Java 的自由实现，例如 <a href="https://objectcomputing.com/resources/publications/sett/january-2003-gcj-the-gnu-compiler-for-java">GNU Java编译器</a>（GCJ）和 <a href="/software/classpath">GNU Classpath</a>，但它们尚不支持所有功能。我们仍在追赶。

note: type: Content of: <div><p>
en: If you develop a Java program on Sun's Java platform, you are liable to use Sun-only features without even noticing. By the time you find this out, you may have been using them for months, and redoing the work could take more months. You might say, &ldquo;It's too much work to start over.&rdquo; Then your program will have fallen into the Java Trap; it will be unusable in the Free World.
zh_CN: 如果您在 Sun 的 Java 平台上开发 Java 程序，则有可能在不注意的情况下使用仅限 Sun 的功能。到您发现此问题时，您可能已经使用了几个月，并且重做工作可能需要花费几个月的时间。&ldquo;您可能会说，从头开始要做太多的工作了。&rdquo;然后，您的程序将落入 Java 陷阱中。它在自由世界中将无法使用。

note: type: Content of: <div><p>
en: The reliable way to avoid the Java Trap is to have only a free implementation of Java on your system. Then if you use a Java feature or library that free software does not yet support, you will find out straightaway, and you can rewrite that code immediately.
zh_CN: 避免 Java 陷阱的可靠方法是在系统上只有 Java 的自由实现。然后，如果您使用的是自由软件尚不支持的 Java 功能或库，那么您将立即发现并可以立即重写该代码。

note: type: Content of: <div><p>
en: Sun continues to develop additional &ldquo;standard&rdquo; Java libraries, and nearly all of them are nonfree; in many cases, even a library's specification is a trade secret, and Sun's latest license for these specifications prohibits release of anything less than a full implementation of the specification. (See the <a href="https://jcp.org/aboutJava/communityprocess/JSPA2.pdf"> Java Specification Participation Agreement</a> and the <a href="https://jcp.org/aboutJava/communityprocess/final/jsr129/j2me_pb-1_0-fr-spec-license.html"> J2ME&trade; Personal Basis Profile Specification</a> for examples.)
zh_CN: Sun 继续开发其他标准 Java 库，并且几乎所有的库都是非自由的。在许多情况下，即使是库的&ldquo;规范&rdquo;也是商业秘密，并且 Sun 针对这些规范的最新许可证禁止发布除规范的完整实现之外的任何内容。（请参看 <a href="https://jcp.org/aboutJava/communityprocess/JSPA2.pdf">https://jcp.org/aboutJava/communityprocess/JSPA2.pdf</a> 和 <a href="https://jcp.org/aboutJava/communityprocess/final/jsr129/j2me_pb-1_0-fr-spec-license.html">https://jcp.org/aboutJava/communityprocess/final/jsr129/j2me_pb-1_0-fr-spec-license.html</a> 等示例。）

note: type: Content of: <div><p>
en: Fortunately, that specification license does permit releasing an implementation as free software; others who receive the library can be allowed to change it and are not required to adhere to the specification.  But the requirement has the effect of prohibiting the use of a collaborative development model to produce the free implementation. Use of that model would entail publishing incomplete versions, something those who have read the spec are not allowed to do.
zh_CN: 幸运的是，该规范许可证确实允许以自由软件的形式发布实现；可以允许其他接收该库的人进行更改，而无需遵守该规范。但是该要求具有禁止使用协作开发模型来产生自由实现的效果。使用该模型将需要发布不完整的版本，而那些已经阅读过该规范的人将被禁止这样做。

note: type: Content of: <div><p>
en: In the early days of the free software movement, it was impossible to avoid depending on nonfree programs. Before we had the GNU C compiler, every C program (free or not) depended on a nonfree C compiler. Before we had the GNU C library, every program depended on a nonfree C library. Before we had Linux, the first free kernel, every program depended on a nonfree kernel.  Before we had BASH, every shell script had to be interpreted by a nonfree shell. It was inevitable that our first programs would initially be hampered by these dependencies, but we accepted this because our plan included rescuing them subsequently. Our overall goal, a self-hosting GNU operating system, included free replacements for all those dependencies; if we reached the goal, all our programs would be rescued. Thus it happened: with the GNU/Linux system, we can now run these programs on free platforms.
zh_CN: 在自由软件运动的早期，不可避免地要依赖非自由程序。在拥有GNU C编译器之前，每个C程序（无论是否自由）都依赖于非自由的C编译器。在拥有GNU C库之前，每个程序都依赖于一个非自由的C库。在我们拥有第一个自由内核 Linux 之前，每个程序都依赖于非自由内核。在有 BASH 之前，每个 shell 脚本都必须由非自由 shell 解释。不可避免的是，最初的程序一开始会受到这些依赖的阻碍，但是我们接受了这一点，因为我们的计划包括随后的救援。我们的总体目标是建立一个自洽的 GNU 操作系统，其中包括所有这些依赖项的自由替代。如果我们达到了目标，我们的所有程序都会被拯救。事情就这样发生了：有了 GNU/Linux 系统，我们现在可以在自由平台上运行这些程序了。

note: type: Content of: <div><p>
en: The situation is different today. We now have powerful free operating systems and many free programming tools. Whatever job you want to do, you can do it on a free platform; there is no need to accept a nonfree dependency even temporarily. The main reason people fall into the trap today is because they are not thinking about it. The easiest solution to the problem is to teach people to recognize it and not fall into it.
zh_CN: 今天的情况有所不同。我们现在拥有功能强大的自由操作系统和许多自由的编程工具。无论您想做什么工作，都可以在自由的平台上完成；甚至不需要暂时接受非自由依赖。人们今天落入陷阱的主要原因是因为他们没有对此进行考虑。解决该问题的最简单方法是教会人们认识它并且不陷入它。

note: type: Content of: <div><p>
en: To keep your Java code safe from the Java Trap, install a free Java development environment and use it. More generally, whatever language you use, keep your eyes open, and check the free status of programs your code depends on. The easiest way to verify that a program is free is by looking for it in the <a href="https://www.fsf.org/directory">Free Software Directory</a>.  If a program is not in the directory, you can check its license(s)  against the <a href="/licenses/license-list.html">list of free software licenses</a>.
zh_CN: 为了使 Java 代码免受 Java 陷阱的影响，请安装自由的 Java 开发环境并使用它。一般来说，无论使用哪种语言，请睁大眼睛，检查代码所依赖的程序的自由状态。验证程序是否自由的最简单方法是在“自由软件目录”（<a href="https://www.fsf.org/directory">自由软件目录</a>）查找。如果程序不在目录中，则可以对照 <a href="/licenses/license-list.html">自由软件许可证列表</a> 审查其许可证。

note: type: Content of: <div><p>
en: We are trying to rescue the trapped Java programs, so if you like the Java language, we invite you to help in developing GNU Classpath. Trying your programs with the GCJ Compiler and GNU Classpath, and reporting any problems you encounter in classes already implemented, is also useful.  However, finishing GNU Classpath will take time; if more nonfree libraries continue to be added, we may never have all the latest ones. So please don't put your free software in shackles. When you write an application program today, write it to run on free facilities from the start.
zh_CN: 我们正试图挽救被困的 Java 程序，因此，如果您喜欢 Java 语言，我们邀请您一起帮助开发 GNU Classpath。使用GCJ编译器和 GNU Classpath 验证你的程序，并报告在已实现的类中遇到的任何问题也很有用。然而，完成 GNU Classpath 需要花费时间；如果非自由库的还在持续增加，我们可能永远不会有所有最新的库。因此，请不要给您的自由软件套上枷锁。今天，当您编写应用程序时，请一开始就按照在自由工具上运行的目标来编写。

note: type: Content of: <div><h3>
en: See also:
zh_CN: 请同时参看：

note: type: Content of: <div><div><p>
en: Please send general FSF &amp; GNU inquiries to <a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a>.  There are also <a href="/contact/">other ways to contact</a> the FSF.  Broken links and other corrections or suggestions can be sent to <a href="mailto:webmasters@gnu.org">&lt;webmasters@gnu.org&gt;</a>.
zh_CN: 请将有关自由软件基金会(FSF)&amp; GNU 的一般性问题发送到<a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a>。也可以通过 <a href="/contact/">其他联系方法</a> 联系自由软件基金会(FSF)。有关错误链接、其他更正或建议，请联系 <a href="mailto:webmasters@gnu.org">&lt;webmasters@gnu.org&gt;</a>。

note: TRANSLATORS: Ignore the original text in this paragraph, replace it with the translation of these two: We work hard and do our best to provide accurate, good quality translations.  However, we are not exempt from imperfection. Please send your comments and general suggestions in this regard to <a hr
en: Please see the <a href="/server/standards/README.translations.html">Translations README</a> for information on coordinating and contributing translations of this article.
zh_CN: 我们尽最大努力来提供精准和高质量的翻译，但难免会存在错误和不足。如果您在这方面有评论或一般性的建议，请发送至 <a href="mailto:web-translators@gnu.org">&lt;web-translators@gnu.org&gt;</a>。</p><p>关于进行协调与提交翻译的更多信息参见 <a href="/server/standards/README.translations.html">《译者指南》</a>。

note: type: Content of: <div><p>
en: This page is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
zh_CN: 本页面使用<a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>授权。

note: TRANSLATORS: Use space (SPC) as msgstr if you don't want credits. type: Content of: <div><div>
en: *GNUN-SLOT: TRANSLATOR'S CREDITS*
zh_CN: <b>翻译</b>:<a rel="team" href="mailto:nios34@disroot.org">Nios34</a><br></br>
    <b>翻译团队</b>：<a rel="team" href="https://savannah.gnu.org/projects/www-zh-cn/">&lt;CTT&gt;</a>，2020，2021。

note: timestamp start type: Content of: <div><p>
en: Updated:
zh_CN: 最后更新：
