Java FAQ

This collection of frequently asked questions (FAQ) provides brief answers to many common questions about the Sun JavaTM Platform, programming language, and the Java Development Kit (JDK). It also provides links to more detailed information ava ilable from this web site.

Getting started with Java:

  1. What releases of Java are currently available? What do they contain?
  2. What platforms is the JDK available on?
  3. What about a version for my favorite platform XYZ? When can I get it?
  4. Where can I find information about HotJava?
  5. How can I get started with programming in Java?
  6. Do I need special server software to use applets?
  7. Is JavaScript available? How do I find out more about it?
  8. What are the security problems I've heard about JavaScript scripts?
  9. I can't find the API documentation on any classes in the sun.* packages.
  10. Why developers should not write programs that call 'sun' packages
  11. How do I get started with Java technology?

Getting information and staying in touch:

  1. Where did the Java name come from? What does it stand for?
  2. What newsgroups carry information about Java?
  3. How do I become certified as a Java programming language developer?

Java-enabled Netscape:

  1. Can all Netscape 3.x versions run Java applets?
  2. Can you help me with using Java in Netscape?

Marketing, licensing, and planning:

  1. Is Java free? Where can I get information on licensing?
  2. Can I use the Java logo?
  3. How can I invest in Java on the stock market?
  4. How do I get answers to my code questions about the Java programming language?
  5. Where can I get product information?
  6. Where do I send product feedback or questions?
  7. Can I get copies of the JDC applet source code?

Troubleshooting:

  1. Will Java work with DOS file name limitations (8.3)?
  2. javac: Superclass java.applet.Applet of class HelloWorld not found.
  3. How do I stop the copyright notice from appearing every time I start the Windows NT/95 version of appletviewer?
  4. My virus-checker program claims to have found a virus in some of the JDK files. What's going on?
  5. Can you use one and only one Java runtime environment on a single machine? Can there be more? If so, how do I know which application is using which runtime environments?
  6. Do IE and Netscape use different Java runtime environments? If so, how do I check their versions?

Getting started with Java :

1. What releases of Java are currently available? What do they contain?

The Java programming language is currently shipping as a product known as the Java Development Kit. The final Java 1.0 release is JDK 1.0.2 The latest Java 1.1 release is located at the JDK 1.1.x download page

Each release of the Java Development Kit (JDK) contains:

  • Java Compiler
  • Java Virtual Machine
  • Java Class Libraries
  • Java Applet Viewer
  • Java Debugger and other tools

To run Java 1.0 applets, use Netscape Navigator 3.x or other browsers that support Java applets. To run Java 1.1 applets, use Hotjava 1.x or Netscape Navigator 4.x or other browsers that support the newest version of the Java API.

2. What platforms is the JDK available on?

The JDK 1.0.2 is available on these platforms:

  • SPARC Solaris (2.3 or later)
  • Intel x86 Solaris
  • Windows NT/95 (Intel x86)
  • Macintosh 7.5
The JDK 1.1.4 is available on these platforms:
  • SPARC Solaris 2.4,2.5
  • Intel x86 Solaris (early-access)
  • Windows 95/NT 4

3. What about a version for my favorite platform XYZ? When can I get it?

These are extremely popular questions, and important ones. What we can currently say is:

    Amiga, Linux, NeXT, OS/2, Windows 3.1, Windows 32s, ...
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:

5. Where can I find information about HotJava?

The current version of HotJava is 1.1Beta1 and is available at HotJava.

6. How can I get started programming in Java?

See our page which can guide you in the right direction:

7. Do I need special server software to use applets?

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-enabled browser, such as HotJava or 1.x or Netscape 3.x/4.x.

8. Is JavaScript available? How do I find out more about it?

The initial version of JavaScript 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 page:

9. What are the security problems I've heard about JavaScript scripts?

JavaScript is a scripting language used with Netscape Navigator. There have been reports of privacy problems with JavaScript, and Netscape is committed to addressing those concerns. JavaScript cannot be used to invoke Java applets. The privacy problems reported with JavaScript are not present in Java applets.

10. I can't find the API documentation on any classes in the sun.* packages. Where is it?

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 API standard, and are therefore subject to change without notice.

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.

However, if you must have it, the documentation for sun.* is available in the doc comments in the source code release available separately from the JDK. For example, the doc comments for sun.net are in the source files located at:

/src/share/sun/sun/net/*.java

This source code release does not include javadoc-generated documentation. You would have to generate those docs yourself using javadoc.

11. Why developers should not write programs that call 'sun' packages

JavaSoft 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 Why Developers Should Not Write Programs That Call 'sun' Packages.

12. How do I get started with Java technology?

For beginners, there's a starter kit that can help you quickly learn how to write applets and applications. To access the starter kit,click here.
TOP

Getting information and staying in touch:

1. Where did the Java name come from? What does it stand for?

The name was chosen during one of several brainstorming sessions held by the Java 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.

2. What newsgroups carry information about Java?

Several newsgroups are currently available, including:

     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 

3. How do I become certified as a Java programming language developer?

For information regarding the Java Developer Certification program, click here.

TOP

Java-enabled Netscape:

1. Can all Netscape 3.x versions run Java applets?

Netscape 3.x supports Java 1.0 applets on many but not all platforms. See the release notes for your platform at:

Java-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.

Hotjava and Java-enabled versions of Netscape 4.x will run 1.1.x applets, which can be written in with JDK 1.1.x.

2. Can you help me with using Java in Netscape?

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:

TOP

Marketing, licensing, and planning:

1. Is Java free? Where can I get information on licensing?

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

If you have further commercial or licensing questions, please contact our representatives at 1-800-JAVASOFT, for international callers, please dial +1 512 434-1591.

2. Can I use the Java logo?

Sun does not authorize the use of the Java logo. For more information about this and other special developer logos, please see:

Java Trademark Guidelines

3. How can I invest in Java on the stock market?

Java technology is a product of Sun Microsystems, Inc., which is traded on NASDAQ under the symbol SUNW.

4. How do I get answers to my code questions about the Java programming language?

There are several ways to get answers to your questions about Java programming code:

5. Where can I get product information?

Information on specific products and APIs can be found on the Products and APIs page.

6. Where do I send product feedback or questions?

To provide feedback or ask questions regarding specific products or APIs, please use the aliases listed on the Product and API Feedback page.

7. Can I get copies of the JDC applet source code?

Currently the JDC does not provide the source code for its applets. However, as we publish more technical articles about the inner workings of the JDC, we will continue to include excerpts from our source code.

TOP

Troubleshooting:

1. Will Java work with DOS file name limitations (8.3)?

Java relies on files with longer names than the old DOS limits, so if you are running older (pre-Windows 95) versions of DOS, Java 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.

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 web site.

2. javac: Superclass java.applet.Applet of class HelloWorld not found.

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, and do all further development with that.

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 system is case-sensitive, so a HelloWorld class is different from a helloWorld class, and so on.

3. How do I stop the copyright notice from appearing every time I start the Windows NT/95 version of appletviewer?

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.

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.

Once your home directory is set, all you need to do for Windows NT3.51 is to c@ €€HH €Há: ðñ =¤n @E%%HOMEPATH%\.hotjava

In Windows 95, the easiest method is to edit the AUTOEXEC.BAT file, adding the following line:

set HOME=C:\

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:

mkdir %HOME%.hotjava

4. My virus-checker program claims to have found a virus in some of the JDK files. What's going on?

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 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.

5.Can you use one and only one Java runtime environment on a single machine? Can there be more? If so, how do I know which application is using which runtime environments?

There can be more than one runtime environments. You can install different runtime environments, and you can invoke multiple runtime environments in parallel. All run in their own address space and know nothing of one another. Which program uses which runtime environment is very system dependant. From the JavaTM program itself, you can try: System.getProperty("java.home")

See the Java API Documentation:
java.lang Package

getProperties

public static Properties getProperties()

Determines the current system properties.
Below are the descriptions of associated values, followed by the value:

Java Runtime Environment version:
java.version

Java Runtime Environment vendor:
java.vendor

Java vendor URL:
java.vendor.url

Java installation directory:
java.home

Java Virtual Machine1 specification version:
java.vm.specification.version

Java Virtual Machine specification vendor:
java.vm.specification.vendor

Java Virtual Machine specification name:
java.vm.specification.name

Java Virtual Machine implementation version:
java.vm.version

Java Virtual Machine implementation vendor:
java.vm.vendor

Java Virtual Machine implementation name:
java.vm.name

Java Runtime Environment specification version:
java.specification.version

Java Runtime Environment specification vendor:
java.specification.vendor

Java Runtime Environment specification name:
java.specification.name

Java class format version number:
java.class.version

Java class path:
java.class.path

Operating system name:
os.name

Operating system architecture:
os.arch

Operating system version:
os.version

File separator ("/" on UNIX):
file.separator

Path separator (":" on UNIX):
path.separator

Line separator ("\n" on UNIX):
line.separator

User's account name:
user.name

User's home directory:
user.home

User's current working directory:
user.dir

6. Do IE and Netscape use different Java runtime environments? If so, how do I check their versions?

Open the Java console in the browser to see a message with a version number. The Netscape implementations I know about use the same versioning scheme as the Sun JDKTM (apart from implementation errors, which made Netscape's Java 1.1.4 or lower impossible to use as 1.1). MSIE uses its own versioning scheme that cannot reliably be mapped to any JDK release.

See more FAQ at : -
www.java.com
Sun SITE UNC
TOP