java 所有的java小程序都去哪儿了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51390/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where did all the java applets go?
提问by Tyler
When java was young, people were excited about writing applets. They were cool and popular, for a little while. Now, I never see them anymore. Instead we have flash, javascript, and a plethora of other web app-building technologies.
在 Java 还年轻的时候,人们对编写小程序感到兴奋。他们很酷很受欢迎,有一段时间。现在,我再也见不到他们了。相反,我们有 flash、javascript 和大量其他 Web 应用程序构建技术。
Why don't sites use java applets anymore?
为什么网站不再使用 Java 小程序?
I'm also curious: historically, why do you think this occurred? What could have been done differently to keep Java applets alive?
我也很好奇:从历史上看,你认为为什么会发生这种情况?可以采取哪些不同的方式来保持 Java 小程序的活力?
采纳答案by Jon Limjap
I think Java applets were overshadowed by Flash and ActionScript (pun unintended), being much easier to use for what Java Applets were being used at the time (animations + stateful applications).
我认为 Java 小程序被 Flash 和 ActionScript(意料之外的双关语)所掩盖,更容易用于当时使用的 Java 小程序(动画 + 有状态应用程序)。
Flash's success in this respect in turn owes to its much smaller file sizes, as well as benefiting from the Sun vs. Microsoft suit that resulted in Microsoft removing the MSJVM from Internet Explorer, at a time of Netscape's demise and IE's heavy dominance.
Flash 在这方面的成功反过来又要归功于它小得多的文件大小,以及受益于 Sun 与 Microsoft 的诉讼,导致 Microsoft 在 Netscape 消亡和 IE 占据主导地位的时候从 Internet Explorer 中删除了 MSJVM。
回答by Tony BenBrahim
1) AWT made for horrid UIs. Swing improved on that but it was too late, because...
2) Microsoft dropped support for Java in the browser (its propietary MSJVM), and before it did, it would only support the last version it released, which was roughly JDK 1.1 compatible.
3) So today you cannot be sure that an applet will run on the majority of non-developer machines, unlike flash.
1) AWT 是为可怕的 UI 设计的。Swing 对此有所改进,但为时已晚,因为...
2) 微软在浏览器中放弃了对 Java 的支持(其专有的 MSJVM),在此之前,它只支持它发布的最后一个版本,大约是 JDK 1.1兼容的。
3) 所以今天你不能确定一个applet 会在大多数非开发者的机器上运行,这与flash 不同。
Same can be said of ActiveX by the way.
顺便说一下,ActiveX 也是如此。
回答by feoh
For what it's worth, Sun is pouring money and resources into applets again. They've made some really significant improvements in JDK 1.6.10to mitigate a lot of the 'clunkiness' applets used to exhibit. For instance, with this update, you can display your own custom loading image/animation while your applet loads, and the plugin has been put on a major diet to improve performance.
就其价值而言,Sun 再次将资金和资源投入到小程序中。他们在JDK 1.6.10 中进行了一些非常显着的改进,以减轻过去表现出的许多“笨拙”小程序。例如,通过此更新,您可以在加载小程序时显示您自己的自定义加载图像/动画,并且该插件已被用于提高性能。
They've also embarked upon an initiative to directly compete with Flash and Silverlight - JavaFX.
他们还开始主动与 Flash 和 Silverlight- JavaFX直接竞争。
Whether or not the market will respond to any of this remains to be seen, but it's certainly a fascinating move on Sun's part given Flash's dominance in the market place.
市场是否会对此做出反应还有待观察,但鉴于 Flash 在市场上的主导地位,这对 Sun 来说无疑是一个令人着迷的举措。
回答by Jonathan Allen
By the time Java's GUI API stopped totally sucking, everyone was using Flash. And even today, Java is no where near as good as Flash at doing fancy graphics.
当 Java 的 GUI API 完全停止时,每个人都在使用 Flash。即使在今天,Java 在制作精美的图形方面也不如 Flash。
回答by Blorgbeard is out
I assume it's because java is a "real", ie. general purpose language. To make an applet, you have to write code, and there aren't any shortcuts.
我认为这是因为 java 是“真实的”,即。通用语言。要做一个小程序,你得写代码,没有什么捷径可走。
Now that flash etc have come along, you can pretty much just drap and drop your way through making a cool animation for your website. This is a much lower barrier for entry - you don't have to know how to program in order to get a flash animation working. So flash proliferates, and java applets are hardly used anymore.
现在 Flash 等已经出现,您几乎可以通过为您的网站制作一个很酷的动画来随意放置。这是一个低得多的入门门槛 - 您不必知道如何编程才能使 Flash 动画工作。所以闪存激增,Java 小程序几乎不再使用。
回答by diciu
I think applets are collateral damage in the battle between Microsoft and Sun.
我认为小程序是微软和 Sun 之间的战斗中的附带损害。
At first, the JVM was very slow to load and demanded too much memory. Then, when increase in computing power made the JVM possible, Sun played hard as it attempted to control all things Java:
起初,JVM 加载速度很慢并且需要太多内存。然后,当计算能力的增加使 JVM 成为可能时,Sun 努力控制 Java 的所有事物:
As part of another private antitrust lawsuit filed against Microsoft by Sun in March, Sun sought a preliminary injunction requiring Microsoft to include a current Java virtual machine (JVM) in the Windows XP operating system. Microsoft said the decision to include the JVM this week is a direct result of the latest legal entanglement with Sun, but Microsoft plans to disband support for Java in Windows following Jan. 1, 2004. Microsoft Reverses Course, Will Include Java VM In Windows XP--For Now
作为 Sun 在 3 月份对微软提起的另一项私人反垄断诉讼的一部分,Sun 寻求初步禁令,要求微软在 Windows XP 操作系统中包含当前的 Java 虚拟机 (JVM)。微软表示,本周包含 JVM 的决定是与 Sun 最新法律纠葛的直接结果,但微软计划在 2004 年 1 月 1 日之后在 Windows 中取消对 Java 的支持。微软逆转课程,将在 Windows XP 中包含 Java VM - 目前
回答by bpapa
They took forever to load up and get going in the browser, and then for a lot of people they didn't work. When they finally did load, the interfaces were ugly and clunky. I think the poor user experience was a big step towards making applets obsolete.
他们花了很长时间来加载并进入浏览器,然后对很多人来说他们不起作用。当他们最终加载时,界面又丑又笨重。我认为糟糕的用户体验是让小程序过时的一大步。
So to answer the original question I have a question of my own - you ask "Why don't sites use java applets anymore", and my response is "why would anyone want to?"
所以为了回答最初的问题,我有一个自己的问题——你问“为什么网站不再使用 java 小程序”,我的回答是“为什么有人想要?”
回答by Frank Krueger
I see them a lot in acedemic settings (hosted on department or faculty sites), but you're right in that they are not very popular.
我在学术环境中经常看到它们(在院系或教师网站上托管),但您是对的,因为它们不是很受欢迎。
However, remember that Java's big promise has been achieved. We have Flash, Java Applets, Silverlight, and ever-improving JavaScript frameworks.
但是,请记住 Java 的巨大承诺已经实现。我们有 Flash、Java Applet、Silverlight 和不断改进的 JavaScript 框架。
Now if I made add a personal opinion - I think that Java applets are inelegant. They tend to look ugly, the Java runtime makes its presence in the OS far too known (in terms of runtime visuals, updates, and the ugly installer). Flash is much better with its rich media environment and its transparent (and ubiquitous) deployment.
现在,如果我提出个人意见 - 我认为 Java 小程序是不雅的。它们往往看起来很丑,Java 运行时在操作系统中的存在太广为人知(在运行时视觉效果、更新和丑陋的安装程序方面)。Flash 凭借其丰富的媒体环境和透明(且无处不在)的部署要好得多。
回答by Georgy Bolyuba
回答by Dave Webb
I think compatibility issues were a big problem. Most notably with IE and Microsoft's Java VM which wasn't as standards compliant as it might have been.
我认为兼容性问题是一个大问题。最值得注意的是 IE 和 Microsoft 的 Java VM,它们不像它可能那样符合标准。
Even with the Sun JVM you could have problems. I've had fun where I've had two 3rd-party Applets requiring different versions of Java which causes all sorts of problems. Sun have tried to solve this problem by replacing Applets with Java Web Startwhich gives you a link in the browser that launches the application in it's own window instead of inside the browser. (In theory with JWS you can have different applications using different VMs but it never seems to work for me as well as it should.)
即使使用 Sun JVM,您也可能会遇到问题。我玩得很开心,因为我有两个 3rd-party Applet,它们需要不同版本的 Java,这会导致各种问题。Sun 试图通过用Java Web Start替换 Applets 来解决这个问题,Java Web Start在浏览器中提供一个链接,在它自己的窗口中而不是在浏览器内启动应用程序。(理论上,对于 JWS,您可以使用不同的 VM 拥有不同的应用程序,但它似乎对我来说永远不会像它应该的那样工作。)
Advancements with JavaScript have also made it possible to developer much richer web pages so a lot of things in the past that you could only do in Applets can now be done simply with AJAX.
JavaScript 的进步也使开发更丰富的网页成为可能,因此过去只能在 Applet 中完成的许多事情现在可以通过 AJAX 轻松完成。

