📄 00000000.htm
字号:
Time-Warner. <BR> <BR>Fortuitously, Sun lost the bid. The Time-Warner project went nowhere, the same place it probably <BR>would have gone if Sun had won the bid. First Person continued work on settop boxes until early <BR>1994, when it concluded that like smart consumer electronics settop boxes were more hype than <BR>reality. <BR> <BR>Without a market to be seen First Person was rolled back into Sun in 1994. However around this <BR>time it was realized that the requirements for smart consumer electronics and settop box software <BR>(small, platform independent secure reliable code) were the same requirements for the nascent <BR>web. <BR> <BR>For a third time the project was redirected, this time at the web. A prototype browser called <BR>WebRunner was written by Patrick Naughton in one weekend of inspired hacking. After additional <BR>work by Naughton and Jonathan Payne this browser became HotJava. The rest, as they say, is <BR>history. <BR> <BR>Information in this section is primarily based on the first hand accounts of Bill Joy and Patrick <BR>Naughton (which don't always agree). No doubt other people have still different memories of what <BR>occurred. If you've got any more first hand information about what went on in the Green project <BR>I'd like to hear from you. <BR> <BR>1.2: Doesn't the World Wide Web have something to do with this? <BR> <BR>Not necessarily. Java is a programming language. When work began on what has become Java, the <BR>World Wide Web was just getting started at CERN; and Mosaic wasn't even a glint in Marc <BR>Andreesen's eye. The original use of the Java language (settop boxes) required security and the <BR>ability to execute code from untrusted hosts. It turns out these are virtually the same requirements <BR>for allowing people to download and run programs from the Web. No other language has the <BR>built-in security of Java. The key here is the security features. The object-oriented nature of Java <BR>is secondary, and mainly reflects the preferences and prejudices of the developers who set out to <BR>write a secure language. The C-like syntax of the language is even less crucial. <BR> <BR>At the lowest level the advantage of Java to the web is that it provides a secure, cross-platform <BR>way for code to be executed. At a somewhat higher level Java adds several features to existing web <BR>sites: <BR> <BR>Arbitrary Graphics <BR> Java lets the server draw pictures in a window on the client. In theory this allows a web page <BR> to do anything a regular program can do by drawing in a window. <BR> <BR>Arbitrary Data Types <BR> In practice rather than using graphics primitives to create your desired web page you'd use a <BR> graphics program to draw the page and then write a program that could read and display the <BR> file formats of that program. Java lets you write content handlers that display any particular <BR> data format. This way you can download your data and your data display program rather <BR> than downloading a bitmapped snapshot of the display. People are already using this to add <BR> sound and animation to web pages. Rather than having to download a file and spawn an <BR> external viewer, the viewer is included with the data; and the data is displayed right on the <BR> page. <BR> <BR>Less Load On The Server <BR> CPU intensive cgi-bin scripts place a large load on a server, particularly at busy sites. With <BR> Java you can offload the calculations to the client's PC. I've written an applet that calculates <BR> all possible ram configurations for a given Mac model. However on models with many <BR> memory slots the sheer number of permutations can tie up even a fast machine for several <BR> hours. Publishing this as a cgi-bin would bring my server to its knees, but by publishing it as <BR> a Java applet I can distribute the load across all the machines that want to run it. <BR> <BR>More User Interaction <BR> Finally Java allows for more interaction with the user. Java not only allows you to paint <BR> arbitrary data on the screen. It also allows you to collect input from the user in the form of <BR> mouse clicks, keystrokes and the like. This lets you put almost any application on your web <BR> page that doesn't require disk access. <BR> <BR>1.3: What platforms does Java run on? <BR> <BR>Sun has made a Java development kit available for Sparc and X86 Solaris, Windows NT for Intel, <BR>Windows 95, MacOS 7.5 on PowerMacs and 68030 (25 MHz and faster) and 68040 Macs. <BR> <BR>An IRIX port has mostly been completed by Simon Leinen. SGI's own port is available at <BR><A HREF="http://www.sgi.com/Fun/Free_webtools.html">http://www.sgi.com/Fun/Free_webtools.html</A> <BR> <BR>A Linux port is in fairly good shape. See <A HREF="http://java.blackdown.org/java-linux.html.">http://java.blackdown.org/java-linux.html.</A> <BR> <BR>IBM has ported Java to Windows 3.1, OS/2, and AIX. It is working on ports for MVS and OS/400. <BR>See <A HREF="http://ncc.hursley.ibm.com/javainfo/hurindex.html">http://ncc.hursley.ibm.com/javainfo/hurindex.html</A> . <BR> <BR>The OSF has ported Java to Unixware, the Bull Estrella or other PowerPC running AIX4.1, X86 <BR>running DASCOM OSF/1 , the Digital Alpha running Digital UNIX 3.2 , the HP700 series <BR>running HPUX 10.x, the NCR Globalyst (Pentium) running UNIX SysV, and Sony NEWS (MIPS) <BR>running Sony NEWS 6.1.1. See <A HREF="http://www.osf.org/mall/web/JDK/.">http://www.osf.org/mall/web/JDK/.</A> <BR> <BR>Other ports are underway for Nextstep, SunOS 4.1, the Amiga and possibly other platforms. <BR> <BR>In the past new versions of Java have most often been made available first for Solaris. If you have <BR>to have the latest version as soon as it's released, or if you're developing "Bet your company" <BR>applications with Java, you should probably be running Solaris on a SparcStation. Otherwise, if <BR>you just want to learn the language, you can get away with an Intel based Windows 95 or NT <BR>machine with a lot of RAM. <BR> <BR>Netscape 2.0 and later plays Java applets on Windows NT, Windows 95, Solaris, SunOS 4.1, Linux <BR>and most other Unix platforms. Netscape 3.0 for the Mac also supports Java. Netscape 2.0 can even <BR>compile Java programs. (Netscape 3.0 cannot). <BR> <BR>First download the classes.zip file from the Solaris distribution of the JDK. (You have to <BR>download the entire JDK. You can't get just the classes.zip file.) Next set your CLASSPATH <BR>environment variable to include the classes.zip file. For example, on Unix, if you put the file in <BR>/usr/local/lib/classes.zip, then you would set it like this: <BR> <BR>sh: % CLASSPATH=$CLASSPATH:/usr/local/lib/classes.zip <BR>csh: % setenv CLASSPATH "$CLASSPATH:/usr/local/lib/classes.zip" <BR> <BR>You'll probably want to put this line in your .login or .cshrc file. Of course you'll need to adjust <BR>this to match where you've installed these files and to add any other classes you use. Finally you <BR>compile programs from the command line like this: <BR> <BR>% netscape -java sun.tools.javac.Main HelloWorld.java <BR> <BR>You can always alias netscape -java sun.tools.javac.Main to just javac to make this <BR>more transparent. <BR> <BR>You can also run command-line programs that don't use the AWT in the same way, like this: <BR> <BR>% netscape -java HelloWorld.class <BR> <BR>You can't use netscape -java to run programs that use the AWT, but you can of course play <BR>applets in Netscape.. <BR> <BR>1.4: Do I need to know C++ to learn Java? <BR> <BR>No. Java is in fact a much easier language to learn than C++. <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -