您的位置:首页 > 产品设计 > UI/UE

Frequently Asked Questions About Java

2009-02-10 11:28 459 查看
This collection of frequently asked questions (FAQ) provides brief answers to many common questions about the Sun Java<FONT size=-2></FONT> Platform, programming language, and the Java 2 Platform. It also provides links to more detailed information available from this web site. Please check here for answers before posting a question to one of the Java technology-related newsgroups or before sending email to any of the addresses at <A href="http://java.sun.com/mail/index.html" target=_blank>Java Software e-mail addresses</A>.
<P><A href="http://java.sun.com/products/jdk/faq.html#A" target=_blank>A. Getting started with Java:</A><BR>availability, latest releases, ports, downloading, installing, Java technology
<P><A href="http://java.sun.com/products/jdk/faq.html#B" target=_blank>B. Getting information and staying in touch:</A><BR>the Java name, documentation of all sorts, newsgroups, mailing lists, Java class courses, bug reports
<P><A href="http://java.sun.com/products/jdk/faq.html#C" target=_blank>C. Java technology-enabled Netscape:</A><BR>which versions, alpha/beta applets
<P><A href="http://java.sun.com/products/jdk/faq.html#D" target=_blank>D. Marketing, licensing, and planning:</A><BR>licensing, logos, plans
<P><A href="http://java.sun.com/products/jdk/faq.html#E" target=_blank>E. Troubleshooting:</A><BR>error messages
<P>We try to make as much information as possible available through our Web site, <A href="http://java.sun.com/index.jsp" target=_blank>http://java.sun.com/</A>. If you have trouble finding the information you need there, <A href="http://java.sun.com/cgi-bin/feedback.pl" target=_blank>please let us know</A>.
<P><BR><BR>
<CENTER><img height=7 alt="" src="http://java.sun.com/images/misc/bar.gif" width=112 onload='DrawImage(this)'></CENTER><BR><BR><A href="http://java.sun.com/products/jdk/faq.html#top" target=_blank><img height=20 alt="Return to Top" hspace=30 src="http://java.sun.com/images/misc/arrow.gif" width=12 align=right border=0 onload='DrawImage(this)'></A>
<H2><A name=A>A. Getting started with Java Technology:</A> </H2>
<P><A href="http://java.sun.com/products/jdk/faq.html#A1" target=_blank>A1. What releases of Java technology are currently available? What do they contain?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A2" target=_blank>A2. What platforms is the JDK software available on?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A3" target=_blank>A3. Should I use the Production Release or Reference Implementation of the Solaris JDK software and JRE?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A4" target=_blank>A4. What about a version for my favorite platform? When can I get it?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A5" target=_blank>A5. How do I download Java technology and/or JDK software? How do I install it?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A6" target=_blank>A6. Where can I find information about HotJava?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A7" target=_blank>A7. How can I get started with programming in Java?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A8" target=_blank>A8. Do I need special server software to use applets?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A9" target=_blank>A9. Who is licensing Java technology?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A10" target=_blank>A10. Is JavaScript available? How do I find out more about it?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A11" target=_blank>A11. What are the security problems I've heard about JavaScript scripts?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A12" target=_blank>A12. I can't find the API documentation on any classes in the sun.* packages.</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A13" target=_blank>A13. Why developers should not write programs that call 'sun' packages</A><BR><A href="http://java.sun.com/products/jdk/faq.html#A14" target=_blank>A14. Where can I get the Java programming language source code?</A><BR><A href="http://java.sun.com/j2se/versioning_naming.html" target=_blank>A15. What is the Java Version/Naming convention?</A><BR>
<P><STRONG><A name=A1>A1. What releases of Java technology are currently available? What do they contain?</A> </STRONG>
<P>The Java programming language is currently shipping from Sun Microsystems, Inc. as the Java 2 SDK and Java 2 Runtime Environment. All Sun releases of the Java 2 Platform software are available from the <A href="http://java.sun.com/j2se/" target=_blank>Java 2 Platform software home page</A> (http://java.sun.com/j2se/).
<P>Each release of the Java 2 SDK, Standard Edition contains:
<P>
<UL>
<LI>Java Compiler
<LI>Java Virtual Machine*
<LI>Java Class Libraries
<LI>Java AppletViewer
<LI>Java Debugger and other tools
<LI>Documentation (in a separate download bundle) </LI></UL>
<P>To run Java 1.0 applets, use Netscape Navigator 3.x or other browsers that support Java applets. To run Java 1.1.x applets, use HotJava 1.x or Netscape Navigator 4.x or other browsers that support the newest version of the Java API.
<P><STRONG><A name=A2>A2.What platforms is the Java-technology software available on?</A></STRONG>
<P>Sun provides ports of the Java 2 Platform for Windows 95, Windows 98, Windows NT, Windows 2000, Solaris-SPARC, Solaris-Intel, and Linux.
<P><STRONG><A name=A3>A3. Should I use the Production Release or Reference Implementation of the Solaris JDK software and JRE?</A> </STRONG>
<P>The following applies to versions prior to 1.3.0. Starting with J2SE 1.3.0, only the production release exists. There is no Solaris reference implementation.
<P><B>Reference Implementation</B> - Those who want the latest Solaris implementation of the JDK software or JRE release and do not require optimized performance can obtain the reference implementations:
<UL>
<LI><A href="http://java.sun.com/j2se/index.jsp" target=_blank>JDK 1.1 Reference Implementation</A>
<LI><A href="http://java.sun.com/j2se/index.jsp" target=_blank>JRE 1.1 Reference Implementation</A>
<LI><A href="http://java.sun.com/products/jdk/1.2/download.html" target=_blank>JDK 1.2 Reference Implementation</A>
<LI><A href="http://java.sun.com/products/jdk/1.2/download.html" target=_blank>JRE 1.2 Reference Implementation</A> </LI></UL>The Solaris binaries are built from the same source code as the Windows version. The 1.1 reference implementations for Solaris do not include a JIT. Reference implementations are distributed as (essentially) a tar file which may be unpacked in any directory, so that root permission is not required for installation.
<P><B>Production Release</B> - In contrast, customers whose applications/applets will be released as products, and who need a Solaris JRE or JDK software with optimized performance, should use the Solaris production releases:
<UL>
<LI><A href="http://www.sun.com/solaris/java" target=_blank>JDK production release</A>
<LI><A href="http://www.sun.com/solaris/jre" target=_blank>JRE production release</A> </LI></UL>The production releases are based on the reference implementation of the same version number, and include a JIT compiler, additional performance tuning, and bug fixes. The production releases are installed as standard Solaris packages, which require root permission for installation.
<P>Varying levels of technical support are available for both the Reference and Production releases through the standard Solaris support channels.
<P>For a further overview of differences between these Solaris JDK software offerings, see <A href="http://java.sun.com/j2se/index.jsp" target=_blank>JDK 1.1 for Solaris - Binary Products Overview</A> and the <A href="http://www.sun.com/solaris/java/faq.html" target=_blank>FAQ for the JDK Solaris Production Release</A>.
<P>
<P><STRONG><A name=A4>A4. What about a version for my favorite platform? When can I get it?</A> </STRONG>
<P>These are extremely popular and important questions. What we can currently say is:
<P><PRE> Amiga, NeXT, OS/2, Windows 3.1, Windows 32s, Macintosh, ...
</PRE>We've provided our source code to make third-party ports like these possible, but we are not officially overseeing or tracking them. For more information, please check out:
<BLOCKQUOTE><A href="http://java.sun.com/j2se/" target=_blank>Platforms Supporting Java technology </A>(http://java.sun.com/cgi-bin/java-ports.cgi) </BLOCKQUOTE>
<P><STRONG><A name=A5>A5. How do I download Java technology and/or Java 2 SDK software? How do I install it?</A> </STRONG>
<P>You can get our releases either with a World Wide Web (WWW) browser or by anonymous ftp. For details, including installation instructions, visit:
<BLOCKQUOTE><A href="http://java.sun.com/j2se/" target=_blank>The Java 2 Platform web site</A> (http://java.sun.com/j2se/) </BLOCKQUOTE>Choose the software you want, and go from there.
<P><STRONG><A name=A6></A>A6. Where can I find information about HotJava browser? </STRONG>
<P>The current version of HotJava browser is 1.1Beta1 and is available at <A href="http://java.sun.com/products/hotjava" target=_blank>HotJava</A>. This page has links to an email address for comments and to HotJava browser known bugs.
<P><STRONG><A name=A7>A7. How can I get started programming in the Java programming language?</A></STRONG>
<P>See our page which can guide you in the right direction:
<BLOCKQUOTE><A href="http://java.sun.com/developer/onlineTraining/new2java/index.html" target=_blank>Getting Started with Java technology</A>. </BLOCKQUOTE><STRONG><A name=A8>A8. Do I need special server software to use applets?</A> </STRONG>
<P>No. Java applets may be served by any HTTP server. On the server side they are handled the same as any other file, such as a text, image, or sound file. All the special action happens when the applet class files are interpreted on the client side by a Java technology-enabled browser, such as HotJava browser or 1.x or Netscape 3.x/4.x.
<P><STRONG><A name=A9>A9. Who is licensing Java technology?</A> </STRONG>
<P>See our "Who's Licensing Java?" page:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/logos/" target=_blank>Who's Licensing Java?</A><BR>(http://java.sun.com/licensees.html) </BLOCKQUOTE>
<P><STRONG><A name=A10>A10. Is JavaScript technology available? How do I find out more about it?</A> </STRONG>
<P>The initial version of the JavaScript technology is available in current releases of Netscape Navigator 3.x. For more information, including a pointer to the full press release, see the Netscape JavaScript technology page:
<P>
<BLOCKQUOTE><A href="http://developer.netscape.com/tech/javascript/index.html" target=_blank>Netscape JavaScript</A> </BLOCKQUOTE><STRONG><A name=A11>A11. What are the security problems I've heard about JavaScript technology scripts?</A></STRONG>
<P>JavaScript technology is a scripting language used with Netscape Navigator. There have been reports of privacy problems with JavaScript technology, and Netscape is committed to addressing those concerns. JavaScript technology cannot be used to invoke Java applets. The privacy problems reported with JavaScript technology are not present in Java applets.
<P><STRONG><A name=A12></A>A12. I can't find the API documentation on any classes in the sun.* packages. Where is it?</STRONG>
<P>The short answer is that we provide documentation only for the public classes in java.*. We do not provide documentation for sun.* because those are the Sun-specific implementation, and specifically not part of the Java technology API standard, and are therefore subject to change without notice.
<P>In general, we don't provide javadoc documentation for sun.* classes in order to discourage developers from writing programs that use them. For further explanation, see the next question.
<P>However, if you must have it, the documentation for sun.* is available in the doc comments in the community source code release available separately, mentioned in question <A href="http://java.sun.com/products/jdk/faq.html#A14" target=_blank>A14</A>. For example, the doc comments for sun.net are in the source files located at: <PRE> /src/share/sun/sun/net/*.java
</PRE>This source code release does not include javadoc-generated documentation. You would have to generate those docs yourself using javadoc.
<P><STRONG><A name=A13></A>A13. Why developers should not write programs that call 'sun' packages</STRONG>
<P>Java Software supports into the future only classes in java.* packages, not sun.* packages. In general, API in sun.* is subject to change at any time without notice. For more details, see the article <A href="http://java.sun.com/products/jdk/faq/faq-sun-packages.html" target=_blank>Why Developers Should Not Write Programs That Call 'sun' Packages</A>.
<P><STRONG><A name=A14></A>A14. Where can I get the Java programming language source code?</STRONG>
<P>Java Software has two separate bundles of source code that you can obtain at no charge:
<UL>
<LI>The Java 2 SDK, Standard Edition itself contains a file called <CODE>src.zip</CODE> that contains the source code for the public classes in the <CODE>java</CODE> package. Because this does not contain sun.* classes, you cannot do a complete build of the Java technology from these source files. These source files are for your information, to supplement the documentation, so you can see how Java technology works.
<LI>The full <B>source code release</B> is available from us by going to the <A href="http://java.sun.com/communitysource/index.html" target=_blank>Community Source Code Licensing</A> web site.. </LI></UL>
<P><BR><BR>
<CENTER><img height=7 alt="" src="http://java.sun.com/images/misc/bar.gif" width=112 onload='DrawImage(this)'></CENTER><BR><BR><A href="http://java.sun.com/products/jdk/faq.html#top" target=_blank><img height=20 alt="Return to Top" hspace=30 src="http://java.sun.com/images/misc/arrow.gif" width=12 align=right border=0 onload='DrawImage(this)'></A>
<H2><A name=B>B. Getting information and staying in touch:</A> </H2>
<P><A href="http://java.sun.com/products/jdk/faq.html#B1" target=_blank>B1. Where did the Java name come from? What does it stand for?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B2" target=_blank>B2. Can the Java software team keep me informed of latest developments?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B3" target=_blank>B3. What newsgroups carry information about Java technology?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B4" target=_blank>B4. What email addresses are available?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B5" target=_blank>B5. What documentation is available? In what formats? How can I get it?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B6" target=_blank>B6. Can you send me information by regular mail or by email?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B7" target=_blank>B7. Can I be an alpha or beta tester?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B8" target=_blank>B8. Are Java programming language courses available? Where? At what price?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#B9" target=_blank>B9. How do I file bug reports or feature suggestions?</A><BR>
<P><STRONG><A name=B1>B1. Where did the Java name come from? What does it stand for?</A> </STRONG>
<P>The name was chosen during one of several brainstorming sessions held by the Java software team. We were aiming to come up with a name that evoked the essence of the technology -- liveliness, animation, speed, interactivity, and more. "Java" was chosen from among many, many suggestions. The name is not an acronym, but rather a reminder of that hot, aromatic stuff that many programmers like to drink lots of.
<P><STRONG><A name=B2>B2. Can the Java software team keep me informed of latest developments?</A> </STRONG>
<P>We no longer keep a list of people to inform; when we started that, we never expected that so many people would be writing to us every day! If you'd like to keep informed, the best way is to visit our Web site
<P>
<BLOCKQUOTE><A href="http://java.sun.com/index.jsp" target=_blank>Java Software Home Page</A> (http://java.sun.com/) </BLOCKQUOTE>
<P>periodically and participate in the Java technology-related newsgroups. Note in particular that our "What's New" page:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/features/index.html" target=_blank>What's New at Java Software</A> (http://java.sun.com/features/index.html) </BLOCKQUOTE>
<P>provides an overview of the most recent developments, press releases, and so on concerning Java technology.
<P><STRONG><A name=B3>B3. What newsgroups carry information about Java technology?</A> </STRONG>
<P>Several newsgroups are currently available, including: <!-- BEGIN VCD7 CODE SAMPLE COMPONENT -->
<TABLE class=grey4 cellSpacing=0 cellPadding=10 width="100%" border=0>
<TBODY>
<TR>
<TD><PRE> comp.lang.java
comp.lang.java.advocacy
comp.lang.java.announce
comp.lang.java.api
comp.lang.java.beans
comp.lang.java.databases
comp.lang.java.gui
comp.lang.java.help
comp.lang.java.machine
comp.lang.java.misc
comp.lang.java.programmer
comp.lang.java.security
comp.lang.java.setup
comp.lang.java.softwaretools
comp.lang.java.tech
comp.lang.javascript
</PRE></TD></TR></TBODY></TABLE><SPAN class=sp20></SPAN><BR><!-- END VCD7 CODE SAMPLE COMPONENT --><STRONG><A name=B4>B4. What email addresses are available? </A></STRONG>
<P>Information about our internal e-mail addresses is available at
<P>
<BLOCKQUOTE><A href="http://java.sun.com/mail/index.html" target=_blank>Java Software e-mail addresses</A>. </BLOCKQUOTE>
<P><STRONG><A name=B5>B5. What documentation is available? In what formats? How can I get it?</A> </STRONG>
<P>We provide a wide range of documentation (white papers, API specifications, programmer's guide, and more), reachable from our documentation page:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/white/" target=_blank>Documentation Index</A> (http://java.sun.com/white/)</A> </BLOCKQUOTE>
<P>Most of our documents are available in HTML, PostScript and PDF formats.
<P><STRONG><A name=B6>B6. Can you send me information by regular mail or by email?</A> </STRONG>
<P>Sorry, but we're mainly set up to distribute information through our Web site (<A href="http://java.sun.com/index.jsp" target=_blank>http://java.sun.com/</A>) and ftp site (java.sun.com). We want to get as much information out and available as possible, but we can only handle the volume via these customer-initiated mechanisms.
<P><STRONG><A name=B7>B7. Can I be an alpha or beta tester?</A> </STRONG>
<P>Yes, that's essentially what you're doing when you use our beta release software and send in bug reports. We generally don't have separate formal programs for early-release testing.
<P><STRONG><A name=B8>B8. Are Java programming language courses available? Where? At what price?</A> </STRONG>
<P>SunService is providing Java programming language courses at sites around the world; see
<P>
<BLOCKQUOTE><A href="http://www.sun.com/sunservice/suned/" target=_blank>Sun Educational Services</A> (http://www.sun.com/sunservice/suned/) </BLOCKQUOTE>
<P><STRONG><A name=B9>B9. How do I file bug reports or feature suggestions?</A> </STRONG>
<P>See instructions on our bug report page:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/cgi-bin/bugreport.cgi" target=_blank>Submitting a Bug or Feature Request</A> </BLOCKQUOTE>
<P>We will not be able to acknowledge each report individually. Please accept our gratitude in advance -- your feedback is crucial to our work.
<P><BR><BR>
<CENTER><img height=7 alt="" src="http://java.sun.com/images/misc/bar.gif" width=112 onload='DrawImage(this)'></CENTER><BR><BR><A href="http://java.sun.com/products/jdk/faq.html#top" target=_blank><img height=20 alt="Return to Top" hspace=30 src="http://java.sun.com/images/misc/arrow.gif" width=12 align=right border=0 onload='DrawImage(this)'></A>
<H2><A name=C>C. Java technology-enabled Netscape:</A> </H2>
<P><A href="http://java.sun.com/products/jdk/faq.html#C1" target=_blank>C1. Can all Netscape 3.x versions run Java applets?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#C2" target=_blank>C2. Can you help me with using Java technology in Netscape?</A><BR>
<P><STRONG><A name=C1>C1. Can all Netscape 3.x versions run Java applets?</A> </STRONG>
<P>Netscape 3.x supports Java 1.0 applets on many but not all platforms. See the release notes for your platform at:
<P>
<BLOCKQUOTE><A href="http://home.netscape.com/" target=_blank>Netscape Navigator</A> </BLOCKQUOTE>
<P>Java technology-enabled versions of Netscape 3.x will only run beta and 1.0.2 applets, which can be written with the 1.0.2 Java Development Kit (JDK). Be aware that there are many Web pages with alpha applets, which Netscape 3.x will not handle. You can distinguish between alpha and beta applets by looking at the html source for a page: alpha applets use the <app> tag, whereas beta applets use the <applet> tag.
<P>Hotjava browser and Java technology-enabled versions of Netscape 4.x will run 1.1.x applets, which can be written in with JDK 1.1.x.
<P><STRONG><A name=C2>C2. Can you help me with using Java technology in Netscape?</A> </STRONG>
<P>For questions that specifically concern installation, troubleshooting, feature availability, and how to do something specific with applets in the Netscape browser, it's best to ask Netscape directly. For instance, to report Netscape bugs, you can use:
<P>
<BLOCKQUOTE><A href="http://home.mcom.com/assist/support/client/" target=_blank>Netscape Bug Report</A> </BLOCKQUOTE>
<P><BR><BR>
<CENTER><img height=7 alt="" src="http://java.sun.com/images/misc/bar.gif" width=112 onload='DrawImage(this)'></CENTER><BR><BR><A href="http://java.sun.com/products/jdk/faq.html#top" target=_blank><img height=20 alt="Return to Top" hspace=30 src="http://java.sun.com/images/misc/arrow.gif" width=12 align=right border=0 onload='DrawImage(this)'></A>
<H2><A name=D>D. Marketing, licensing, and planning:</A> </H2>
<P><A href="http://java.sun.com/products/jdk/faq.html#D1" target=_blank>D1. Is Java technology free? Where can I get information on licensing?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#D2" target=_blank>D2. Can I use Sun's Java technology logo?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#D3" target=_blank>D3. What are your plans for XXX functionality? Why haven't you done YYY?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#D4" target=_blank>D4. Can you comment on company ZZZ's plans for licensing and using Java technology?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#D5" target=_blank>D5. How can I invest in Java on the stock market?</A><BR>
<P><STRONG><A name=D1>D1. Is Java technology free? Where can I get information on licensing?</A> </STRONG>
<P>The Java Development Kit (JDK) is free to download and use for commercial programming, but not to re-distribute. We have guidelines on our web site for using and/or licensing Java technology; see
<P>
<BLOCKQUOTE><A href="http://java.sun.com/logos/" target=_blank>Licensing Information</A><BR>(http://java.sun.com/nav/business/) </BLOCKQUOTE>
<P>
<P><STRONG><A name=D2>D2. Can I use Sun's Java technology logo?</A> </STRONG>
<P>Sun does not authorize the use of the Java logo. For more information about this and other special developer logos, please see:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/nav/business/trademark_guidelines.html" target=_blank>Java Trademark Guidelines</A> </BLOCKQUOTE>
<P><STRONG><A name=D3>D3. What are your plans for XXX functionality? Why haven't you done YYY?</A> </STRONG>
<P>We welcome all input regarding Java technology -- we will read and consider it. We're keeping many more options in mind than appear in our current releases. However, because we are focusing on moving toward our next release, we have time to answer only a small number of such questions. See:
<BLOCKQUOTE><A href="http://java.sun.com/cgi-bin/feedback.pl" target=_blank>Contacting Java Software</A> </BLOCKQUOTE>
<P><STRONG><A name=D4>D4. Can you comment on company ZZZ's plans for licensing and using Java technology?</A> </STRONG>
<P>No, we need to let other companies speak for themselves. We can only refer you to official press releases. For pointers to recent press releases, see our "What's New" page:
<P>
<BLOCKQUOTE><A href="http://java.sun.com/pr/archive/pr_2000.html" target=_blank>What's New at Java Software</A> </BLOCKQUOTE>
<P><STRONG><A name=D5>D5. How can I invest in Java technology on the stock market?</A> </STRONG>
<P>Java technology is a product of Sun Microsystems, Inc., which is traded on NASDAQ under the symbol SUNW.
<P><BR><BR>
<CENTER><img height=7 alt="" src="http://java.sun.com/images/misc/bar.gif" width=112 onload='DrawImage(this)'></CENTER><BR><BR><A href="http://java.sun.com/products/jdk/faq.html#top" target=_blank><img height=20 alt="Return to Top" hspace=30 src="http://java.sun.com/images/misc/arrow.gif" width=12 align=right border=0 onload='DrawImage(this)'></A>
<H2><A name=E>E. Troubleshooting:</A> </H2>
<P><A href="http://java.sun.com/products/jdk/faq.html#E1" target=_blank>E1. Will Java technology work with DOS file name limitations (8.3)?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#E2" target=_blank>E2. javac: Superclass java.applet.Applet of class HelloWorld not found.</A><BR><A href="http://java.sun.com/products/jdk/faq.html#E3" target=_blank>E3. How do I stop the copyright notice from appearing every time I start the Windows NT/95 version of appletviewer?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#E4" target=_blank>E4. My virus-checker program claims to have found a virus in some of the JDK software files. What's going on?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#E5" target=_blank>E5. Why do I get a NoClassDefFoundError when I try to run my HelloWorld app?</A><BR><A href="http://java.sun.com/products/jdk/faq.html#E6" target=_blank>E6. Why are Java applets and other interactive content behaving differently in Microsoft® Internet Explorer?</A>
<P><STRONG><A name=E1>E1. Will Java technology work with DOS file name limitations (8.3)?</A> </STRONG>
<P>Java technology relies on files with longer names than the old DOS limits, so if you are running older (pre-Microsoft Windows 95) versions of DOS, Java technology will not work. If you are running a version of DOS (such as the one that comes with Windows 95) that allows long file names, you should not have any problems.
<P>Note that older versions of WinZip do not support long file names, even if the installed version of DOS does. You can get a free upgrade of WinZip with support for long file names from their <A href="http://www.winzip.com/" target=_blank>web site</A>.
<P><STRONG><A name=E2>E2. javac: Superclass java.applet.Applet of class HelloWorld not found.</A> </STRONG>
<P>The examples in the programmer's guide have been updated to conform to the new applet API in our 1.0.2 Java Development Kit (JDK). "Superclass not found" error messages are typical if you try to compile Java 1.0 beta code with an alpha version of javac. The recommended fix is to download a copy of the JDK software, and do all further development with that.
<P>Another potential source of this error message is incorrect capitalization of either the file name or the class name in in the file. The Java technology system is case-sensitive, so a HelloWorld class is different from a helloWorld class, and so on.
<P><STRONG><A name=E3>E3. How do I stop the copyright notice from appearing every time I start the Windows NT/95 version of appletviewer?</A> </STRONG>
<P>The appletviewer looks for a .hotjava directory inside your home directory to determine whether you are starting it for the first time. If the directory is not found, the appletviewer will pop up the copyright notice. The workaround is to manually create the .hotjava directory in your home directory. The following paragraphs explain how to do this.
<P>The appletviewer is written to recognize three MS-DOS environment variables for the location of a user home directory: it uses either HOME or the combination of HOMEDRIVE and HOMEPATH. Under Windows NT3.51, the HOMEDRIVE and HOMEPATH environment variables are set automatically. Under Windows 95, you will need to set the HOME environment variable to point to an existing directory.
<P>Once your home directory is set, all you need to do for Windows NT3.51 is to create the .hotjava directory inside of it: <PRE> mkdir %HOMEDRIVE%%HOMEPATH%/.hotjava
</PRE>
<P>In Windows 95, the easiest method is to edit the AUTOEXEC.BAT file, adding the following line:
<P><PRE> set HOME=C:/
</PRE>
<P>Then save the file and reboot, so that the change to take effect. Once your computer has rebooted, open a DOS window and execute the following command:
<P><PRE> mkdir %HOME%.hotjava
</PRE>
<P><STRONG><A name=E4>E4. My virus-checker program claims to have found a virus in some of the JDK software files. What's going on?</A> </STRONG>
<P>Although your virus checker may have discovered a real virus, you should consider the possibility that a false detection has occurred. Virus-checker programs can mistakenly find "viruses" in parts of the JDK software where there really is no virus. This can happen when the virus checker detects a bit pattern in a class file that, by chance, matches a bit pattern in a virus. The types of viruses that can infect .exe or .com files typically cannot infect class files or jar files.
<P><STRONG><A name=E5>E5. Why do I get a NoClassDefFoundError when I try to run my HelloWorld app?</STRONG>
<P>The problem is probably that your HelloWorld.class file is not on your class path. The class path is the list of one or more directories in which the java application launcher will look for the .class files comprising your application. So, how to specify the class path?
<P>If your program depends only on the J2SE classes, you should not need to use classpath, because those classes are automatically on the classpath. If your program depends on other classes, you need to set classpath to those classes. In that case, it is preferable to use the -classpath option rather than the CLASSPATH environment variable, as the -classpath option enables each application to have its own classpath. For more details, see: </P>
<P>
<UL>
<LI><A href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html" target=_blank>Setting the Class Path for Solaris/Linux</A>
<LI><A href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html" target=_blank>Setting the Class Path for Windows</A> </LI></UL>
<P>Please send questions to the <A href="http://forum.java.sun.com/forum.jsp?forum=7" target=_blank>Compiling forum</A> where others can help you.
<P>The following assumes you're running Windows 95/98/NT/2000.
<P>There is a CLASSPATH environment variable. You can see which environment variables are set on your machine by running 'set' at the DOS prompt. If the CLASSPATH variable is set, then its value is your class path. If the CLASSPATH variable is NOT set, then the default class path is the current directory (i.e. whatever directory you run 'java HelloWorld' from).
<P>So if you are trying to run 'java HelloWorld' from the directory in which the HelloWorld.class file is in, and you get the "can't find" error, it's probably an indication that you have the CLASSPATH environment variable set. Try unsetting the CLASSPATH variable: 'set CLASSPATH=' (i.e. setting it to no value is the same as unsetting it). Then try running your application again. Because the CLASSPATH variable isn't set, the class path should default to the correct directory, and your app should launch.
<P>Altenatively, you could set the CLASSPATH environment variable to point to the location of your HelloWorld.class file. However, you'd run into the same "can't find" error if you then tried to run another application located in another directory.
<P>You can also force the class path to be a particular value by using the -classpath option: 'java -classpath C:/myprograms/ HelloWorld'
<P>See class path information in the <A href="http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html" target=_blank>Java 2 tools documentation</A> for more information.
<P><STRONG><A name=E6>E6. Why are Java applets and other interactive content behaving differently in Microsoft Internet Explorer?</STRONG>
<P>A recent update to Microsoft Internet Explorer included a change that alters the way users interact with applets and other interactive content in the browser. With this change, users are first required to manually activate (click on) the applet's user interface, before the user can interact with the content. If the page has multiple interactive components, users are required to activate each user interface individually. </P>
<P>It is possible to get the old behavior back. Microsoft has published a general solution for updating web pages that restores the user experience. For more information, see the Microsoft article <A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp" target=_blank>Activating ActiveX Controls</A>. Working with Microsoft, Sun has developed an <A href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/ieappletguide/" target=_blank>Internet Explorer deployment guide</A> customized for Java developers, which provides examples on how to leverage the Microsoft work around, and minimize user impact of the Internet Explorer update. </P><B>*As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.</B> <!-- ================================================================= --><!-- End Page Data -->
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: